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:
- Installed SQLsaber
- Access to a database (PostgreSQL, MySQL, SQLite, or DuckDB)
- An API key from a supported AI provider (Anthropic, OpenAI, Google, etc.)
Quick Setup
Section titled “Quick Setup”1. Set Up Authentication
Section titled “1. Set Up Authentication”First, configure your AI provider.
SQLsaber uses Claude Sonnet 4 as the model by default, but supports models from multiple providers.
saber auth setup
This will prompt you to:
- Choose a provider (We recommend Anthropic)
- Enter your API key
2. Add Your Database
Section titled “2. Add Your Database”Add a database connection:
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)
3. Your First Query
Section titled “3. Your First Query”Now you’re ready to ask your first question!
Start SQLsaber in interactive mode:
saber
Try asking a question:
> How many VPs have become presidents via election in 20th century?
SQLsaber will:
- Analyze your database schema
- Generate appropriate SQL
- Execute the query
- Present the results and analysis
Interactive Mode
Section titled “Interactive Mode”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:
- Type
Non-Interactive Mode
Section titled “Non-Interactive Mode”You can also run single queries without entering interactive mode:
# Direct querysaber "How many users are there?"
# Using a specific databasesaber -d my-database "Show me the latest orders"
# Reading from stdinecho "Count all products by category" | saber
# Send output to a filesaber "Show me the latest orders" > latest_orders.md
Next Steps
Section titled “Next Steps”Now that you have SQLsaber running, explore these features:
- Set up memory - Add context about your database for better results
- Manage conversation threads - Resume your conversations
- Configure different models - Try different AI models
- Advanced database setup - Configure SSL, connection strings, and more
Getting Help
Section titled “Getting Help”- Use
saber --help
to see all available commands - Check the command reference for detailed documentation
- Visit our GitHub repository for issues and contributions
Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”“No database connections configured”
saber db list # Check configured databasessaber db add my-db # Add a new database
“Authentication not configured”
saber auth status # Check auth statussaber auth setup # Set up authentication
“Database connection failed”
saber db test my-database # Test the connection
For more troubleshooting help, see our installation guide.