Skip to content

Getting Started

Welcome to SQLsaber! This guide will walk you through setting up SQLsaber and running your first query.

Before you begin, make sure you have:

  1. Installed SQLsaber
  2. Access to a database (PostgreSQL, MySQL, SQLite, or DuckDB)
  3. An API key from a supported AI provider (Anthropic, OpenAI, Google, etc.)

First, configure your AI provider.

SQLsaber uses Claude Sonnet 4 as the model by default, but supports models from multiple providers.

Terminal window
saber auth setup

This will prompt you to:

  • Choose a provider (We recommend Anthropic)
  • Enter your API key

Add a database connection:

Terminal window
saber db add my-database

This interactive command will ask you for:

  • Database type
    • PostgreSQL
    • MySQL
    • SQLite
    • DuckDB
  • Connection details (host, port, database name, username)
  • SSL configuration (if needed)

Now you’re ready to ask your first question!

Start SQLsaber in interactive mode:

Terminal window
saber

Try asking a question:

> How many VPs have become presidents via election in 20th century?

SQLsaber will:

  1. Analyze your database schema
  2. Generate appropriate SQL
  3. Execute the query
  4. Present the results and analysis

In interactive mode, you have access to several helpful features:

  • Slash Commands

    • /clear - Clear the conversation history
    • /exit or /quit - Exit SQLsaber
  • Table Name Autocomplete

    • Type @ followed by a table name to get autocomplete suggestions:

You can also run single queries without entering interactive mode:

Terminal window
# Direct query
saber "How many users are there?"
# Using a specific database
saber -d my-database "Show me the latest orders"
# Reading from stdin
echo "Count all products by category" | saber
# Send output to a file
saber "Show me the latest orders" > latest_orders.md

Now that you have SQLsaber running, explore these features:

“No database connections configured”

Terminal window
saber db list # Check configured databases
saber db add my-db # Add a new database

“Authentication not configured”

Terminal window
saber auth status # Check auth status
saber auth setup # Set up authentication

“Database connection failed”

Terminal window
saber db test my-database # Test the connection

For more troubleshooting help, see our installation guide.