Frequently Asked Questions

SQL Agent CLI is an AI-powered natural language to SQL query generator that helps developers, data analysts, and database administrators write SQL queries faster. Whether you're looking to convert text to SQL, generate complex database queries, or simply learn how to work with PostgreSQL, MySQL, or SQLite databases more efficiently, our AI SQL assistant provides intelligent query suggestions and automated SQL code generation. Get instant answers to your database questions without memorizing SQL syntax.

How do I install SQL Agent CLI?

Installing SQL Agent CLI is quick and straightforward on Windows, macOS, and Linux. First, download the appropriate installer for your operating system from our downloads page. For Windows users, run the .exe installer and follow the setup wizard. macOS users can install via the .pkg installer or use Homebrew with brew install sql-agent. Linux users have multiple options including DEB packages for Debian/Ubuntu, RPM packages for Fedora/CentOS, or a universal TAR archive. After installation completes, open your terminal or command prompt and run sql-agent --help to verify the installation was successful and see available commands. The CLI is a standalone executable with no additional dependencies required. For detailed installation instructions and troubleshooting, visit our documentation page.

How do I activate my license?

Activating your SQL Agent CLI license is a simple one-time process. After purchasing a subscription plan from our pricing page, you'll receive a unique API license key via email and in your account cabinet. Open your terminal or command prompt and run sql-agent login YOUR-LICENSE-KEY, replacing YOUR-LICENSE-KEY with your actual key. The CLI will securely store your credentials locally using encryption and validate the license with our servers. Each license allows activation on a specific number of devices depending on your plan (Free: 1 device, Personal: 2 devices, Professional: 5 devices, Enterprise: unlimited). You can view all your active device installations and deactivate old devices from your cabinet dashboard. If you encounter activation issues, ensure you have an internet connection for license validation, or contact our support team.

Which databases are supported?

SQL Agent CLI provides comprehensive support for the three most popular relational database management systems: PostgreSQL, MySQL, and SQLite. PostgreSQL support includes all modern versions (10+) with full compatibility for PostGIS spatial extensions and advanced data types like JSONB and arrays. MySQL/MariaDB support covers versions 5.7+ including all standard SQL features. SQLite support works with both file-based and in-memory databases, making it perfect for development, testing, and lightweight applications. To connect to a database, use standard database URL connection strings in the format postgresql://user:pass@host:port/dbname for PostgreSQL, mysql://user:pass@host:port/dbname for MySQL, or sqlite:///path/to/database.db for SQLite. The natural language to SQL conversion automatically adapts to your specific database dialect, ensuring generated queries use the correct syntax and functions for each database platform.

Which AI providers can I use?

SQL Agent CLI offers flexible AI provider support, allowing you to choose the LLM that best fits your needs and budget. Supported providers include OpenAI with GPT-4 and GPT-3.5-turbo models for industry-leading accuracy, Anthropic Claude models (Claude 3 Opus, Sonnet, Haiku) known for their strong reasoning capabilities, Groq for ultra-fast inference speeds, DeepSeek for cost-effective solutions, and local Ollama models for completely offline, private operation with no external API calls. To configure your preferred provider, run sql-agent configuration llm.provider --value provider_name (options: openai, anthropic, groq, deepseek, ollama), then set your API key with the appropriate environment variable or configuration command. Using Ollama with models like Llama 2, Mistral, or CodeLlama enables fully offline natural language to SQL conversion without internet connectivity or recurring API costs. Each provider offers different trade-offs between speed, cost, accuracy, and privacy, giving you complete control over your AI SQL assistant infrastructure.

Can I use my license on multiple devices?

Yes! SQL Agent CLI licenses support multiple device activations, allowing you to use the same license key across your work computer, laptop, home desktop, and other machines. The number of simultaneous device activations depends on your subscription plan (see our pricing page for specific limits). The Free plan allows 1 active device, Personal plans support 2 devices, Professional plans include 5 device activations, and Enterprise plans offer unlimited device activations for your entire team. You can view all your currently activated devices, see their last connection time, and remotely deactivate devices you no longer use from your account cabinet. Device deactivation is instant and frees up a slot for activating SQL Agent on a new machine. This flexible device management makes it easy to upgrade hardware, switch between work and personal computers, or share a Professional license across a small development team without purchasing multiple subscriptions.

Does SQL Agent work offline?

SQL Agent can work in limited offline mode with proper configuration. By default, the CLI requires internet connectivity for two purposes: license validation with our servers and sending natural language queries to cloud-based AI providers like OpenAI or Anthropic. However, you can enable offline functionality using two approaches. First, configure "safe mode" by running sql-agent configuration license_fail_mode --value safe, which allows the CLI to continue operating with a warning message when license validation fails due to network issues. Second, for completely offline operation without any internet dependency, configure SQL Agent to use a local Ollama LLM provider running on your machine with sql-agent configuration llm.provider --value ollama. This combination enables fully offline natural language to SQL conversion and database querying, perfect for air-gapped environments, secure corporate networks, or working from locations without reliable internet access. The offline mode maintains all core functionality including schema discovery, query generation, and read-only database operations.

How does natural language querying work?

SQL Agent's natural language to SQL conversion uses advanced AI to understand your database questions and generate accurate SQL queries automatically. When you connect to a database, the AI agent first analyzes your complete database schema including table names, column names, data types, primary and foreign key relationships, indexes, and constraints. This schema understanding allows the AI to interpret your plain English questions contextually. Simply type questions like "Show me all users created this week", "What's the average order value by product category?", or "List the top 10 customers by revenue" and press enter. The AI processes your natural language input, identifies the relevant tables and columns, determines necessary JOIN operations, applies appropriate filters and aggregations, and generates optimized SQL SELECT statements. The generated SQL query is displayed for your review before execution, allowing you to learn SQL syntax patterns and verify the logic. You can also write SQL code directly when you prefer manual control. This text-to-SQL approach dramatically reduces query development time and makes database exploration accessible to anyone who can ask questions in their native language.

Is my data secure?

Absolutely! SQL Agent CLI is designed with security and privacy as top priorities. All sensitive data including database connection strings, usernames, passwords, and API keys are encrypted using industry-standard Fernet encryption and stored locally on your machine in a protected configuration directory with restricted file permissions (0600). Your actual database data, query results, and connection details are never transmitted to our servers or any third party. The only network communication from SQL Agent involves two limited operations: (1) license key validation with our authentication servers to verify your subscription status, and (2) sending your natural language question text (not your data) to your configured AI provider for SQL generation. Importantly, table schemas and data never leave your local machine during AI query generation. SQL Agent runs as a completely local CLI application with no telemetry, analytics, or data collection. You maintain full control over your database credentials and can run SQL Agent in completely offline mode using local Ollama models if your security requirements prohibit any external network access.

Can I prevent accidental data modifications?

Yes! SQL Agent includes comprehensive protection against accidental data modifications through its default read-only mode. When you connect to any PostgreSQL, MySQL, or SQLite database, SQL Agent automatically operates in read-only mode which blocks all dangerous write operations including INSERT, UPDATE, DELETE, DROP TABLE, TRUNCATE, ALTER TABLE, and other data modification statements. If the AI accidentally generates a write query or you type one manually, the query validator rejects it before execution and displays a warning message. This default read-only behavior makes SQL Agent safe for exploring production databases, learning SQL with live data, and performing data analysis without risk of corruption or accidental deletions. When you explicitly need to modify data, you can enable write operations by reconnecting to your database with the --write flag: sql-agent connect --url "your-db-url" --write. Even with write mode enabled, destructive operations trigger confirmation prompts before execution, providing an additional safety layer for your valuable database information.

How do I get support?

We offer comprehensive support for all SQL Agent CLI users across all subscription tiers. For technical support, bug reports, feature requests, or general questions about natural language to SQL querying, database connections, or AI provider configuration, please visit our contact page or contact us directly at info@fintechdocs.ru, +7 495 211 3513, or Telegram @FinTechDocs. We typically respond within 24 hours on business days (Monday-Friday). Before contacting support, check this FAQ page for answers to common questions about installation, license activation, database compatibility, and troubleshooting. Free tier users receive community support via email. Personal and Professional plan subscribers get priority email support with faster response times and detailed technical assistance. Enterprise customers receive dedicated support with phone/video call options, custom integration help, and same-day response guarantees. When reporting issues, please include your SQL Agent version (run sql-agent --version), operating system, database type, and a description of the problem for fastest resolution.

What is natural language to SQL?

Natural language to SQL is a technology that converts plain English questions into SQL database queries. Instead of writing complex SQL syntax manually, you can ask questions like 'Show me all customers from New York' or 'What were last month's sales?' and the AI SQL assistant automatically generates the corresponding SELECT, JOIN, WHERE, and GROUP BY statements. This text-to-SQL conversion makes database querying accessible to non-technical users while saving time for experienced developers. SQL Agent CLI uses advanced AI models from OpenAI, Anthropic, and other providers to understand your intent, analyze your database schema, and produce accurate, optimized SQL code that retrieves exactly the data you need.

How accurate is AI-generated SQL?

SQL Agent's AI-generated SQL queries achieve high accuracy by analyzing your actual database schema before generating queries. The AI agent inspects table structures, column names, data types, relationships, and constraints to ensure queries are syntactically correct and semantically meaningful. For straightforward queries like SELECT statements with simple WHERE clauses, accuracy typically exceeds 95%. Complex queries involving multiple JOINs, subqueries, or aggregations may require minor adjustments, but the AI provides a strong starting point that saves significant development time. The query executor includes built-in validation to catch potential errors before execution, and read-only mode protects against accidental data modifications. Users can review generated SQL before execution and provide feedback to refine results. Accuracy improves further when you use descriptive table and column names that clearly indicate their purpose.

Can SQL Agent handle complex SQL joins and queries?

Yes! SQL Agent CLI can generate complex SQL queries including INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL OUTER JOIN, and self-joins across multiple tables. The AI agent analyzes foreign key relationships and table structures to automatically determine the correct join conditions. It can also handle advanced SQL features like subqueries, Common Table Expressions (CTEs), window functions, aggregations with GROUP BY and HAVING clauses, UNION and INTERSECT operations, and nested SELECT statements. For example, you can ask 'Show me customers who placed orders in the last 30 days with their total spending' and SQL Agent will generate a query joining customers and orders tables, filtering by date, and calculating aggregates. While extremely complex queries with many nested levels may occasionally require manual refinement, the AI provides an excellent foundation that significantly reduces development time for data analysts and developers working with relational databases.

Does SQL Agent support stored procedures?

Currently, SQL Agent CLI focuses on SELECT queries for data retrieval and basic INSERT, UPDATE, and DELETE operations when write mode is enabled. Stored procedures, functions, and triggers are not directly supported for creation or modification through natural language commands. However, you can execute existing stored procedures in your PostgreSQL or MySQL database by writing the CALL or EXEC statement directly in the CLI. The AI agent can help you understand what parameters a stored procedure expects and format the execution command correctly. If your use case requires frequent stored procedure development, we recommend using SQL Agent for exploratory querying and data analysis, then switching to a dedicated database IDE like DBeaver or DataGrip for procedural SQL development. We're exploring stored procedure generation capabilities for future releases based on user feedback and demand.

How does SQL Agent compare to manual SQL writing?

SQL Agent dramatically reduces the time required to write SQL queries, especially for users who aren't SQL experts. While experienced database developers can write optimized queries manually, SQL Agent offers several advantages: instant query generation without memorizing syntax, automatic schema discovery eliminating the need to reference documentation, reduced syntax errors and typos, and faster exploration of unfamiliar databases. For data analysts and business users with limited SQL knowledge, SQL Agent makes database querying accessible without extensive training. Even experienced developers find value in using SQL Agent to quickly prototype queries, explore new database schemas, and handle repetitive query patterns. The AI-generated SQL code is readable, follows best practices, and can be saved for future use or modified as needed. That said, for mission-critical queries requiring extreme performance optimization or complex business logic, manual SQL writing by an expert developer may still be preferable. SQL Agent works best as a productivity tool that augments human expertise rather than replacing it entirely.

Can I learn SQL using SQL Agent CLI?

Absolutely! SQL Agent is an excellent educational tool for learning SQL programming. When you ask a question in plain English, SQL Agent not only executes the query but also displays the generated SQL code, allowing you to see exactly how your natural language request translates into SQL syntax. This immediate feedback helps beginners understand SQL fundamentals including SELECT statements, WHERE clauses, JOIN operations, ORDER BY sorting, and aggregate functions like COUNT, SUM, and AVG. You can experiment with different phrasings and observe how the SQL changes, building intuition for database query patterns. SQL Agent works with real databases (PostgreSQL, MySQL, SQLite), providing hands-on practice rather than abstract exercises. For structured learning, we recommend using SQL Agent alongside traditional SQL tutorials or courses—use the AI to quickly test concepts, explore syntax variations, and verify your understanding. The read-only mode ensures safe experimentation without risk of accidentally modifying data, making it ideal for SQL practice and learning how databases work.

What types of SQL queries can SQL Agent generate?

SQL Agent can generate a wide variety of SQL query types for PostgreSQL, MySQL, and SQLite databases. The most common queries include SELECT statements for data retrieval with filtering, sorting, and pagination; JOIN queries combining data from multiple related tables; aggregate queries using COUNT, SUM, AVG, MIN, MAX with GROUP BY; date and time filtering for temporal data analysis; pattern matching with LIKE and regular expressions; subqueries and nested SELECT statements; UNION and INTERSECT for combining result sets; DISTINCT for removing duplicates; and LIMIT/OFFSET for result pagination. When write mode is enabled with the --write flag, SQL Agent can also generate INSERT statements for adding new records, UPDATE statements for modifying existing data, and DELETE statements for removing records (with built-in safety confirmations). The AI query generator automatically selects appropriate SQL functions, operators, and clauses based on your natural language request and the specific database dialect you're using, ensuring compatibility and optimal performance.

Is SQL Agent suitable for beginners or experienced developers?

SQL Agent CLI is designed for users of all skill levels, from complete SQL beginners to senior database developers. For beginners and non-technical users such as business analysts, product managers, or data analysts with limited coding experience, SQL Agent eliminates the steep learning curve of SQL syntax, allowing immediate database querying through simple English questions. The tool makes database access democratized and accessible without requiring programming knowledge or SQL training. For experienced developers and database administrators, SQL Agent serves as a powerful productivity tool that accelerates query development, reduces boilerplate code, and speeds up database exploration when working with unfamiliar schemas. Senior developers appreciate SQL Agent for rapid prototyping, documentation of query patterns, and automating repetitive data extraction tasks. The CLI's support for multiple LLM providers (OpenAI, Anthropic, local Ollama models) and advanced features like query history and read-only mode make it suitable for professional development environments while remaining approachable for newcomers learning database fundamentals.

How does SQL Agent improve database productivity?

SQL Agent significantly boosts productivity for database-related tasks by reducing query development time from minutes to seconds. Instead of manually writing SQL code, consulting documentation, and debugging syntax errors, users can express their data needs in natural language and receive working queries instantly. The AI database assistant eliminates context switching by keeping you in the terminal rather than switching between SQL editors, schema documentation, and browser tabs. For teams working with multiple databases or frequent schema changes, SQL Agent's automatic schema discovery means you don't need to memorize table names, column names, or relationships—the AI analyzes your database structure in real-time. Read-only mode prevents costly mistakes and accidental data modifications that could require time-consuming recovery. Query history tracking allows you to reference previous queries without searching through notes or files. For data analysts running ad-hoc queries throughout the day, SQL Agent can save hours per week. Development teams report 40-60% faster database query development when using AI SQL tools compared to manual SQL writing, with the largest time savings occurring during database exploration and prototyping phases.

Can SQL Agent help with SQL query optimization?

SQL Agent generates queries that follow SQL best practices and use efficient patterns, but dedicated query optimization for high-performance production systems requires additional tools and expertise. The AI agent avoids common anti-patterns like SELECT * when specific columns are needed, uses appropriate JOIN types based on relationships, and structures WHERE clauses logically. However, SQL Agent doesn't currently provide EXPLAIN plan analysis, index recommendations, or detailed performance metrics. For query optimization, we recommend using SQL Agent to generate an initial working query, then using database-specific tools like PostgreSQL's EXPLAIN ANALYZE, MySQL Query Profiler, or SQLite's query planner to identify bottlenecks. Professional and Enterprise plans include performance analysis features that provide basic query metrics and execution time tracking. If your use case involves optimizing slow queries on large datasets, consider pairing SQL Agent with specialized database monitoring tools like pgBadger for PostgreSQL or dedicated database performance platforms. The combination of fast AI-generated queries plus manual optimization delivers the best results for production database workloads.

Getting Started with SQL Agent CLI

Follow this step-by-step guide to start using SQL Agent's natural language to SQL capabilities within minutes. Whether you're a complete SQL beginner or an experienced database developer, this guide will get you querying PostgreSQL, MySQL, or SQLite databases with AI assistance quickly.

1

Download and Install

Visit our downloads page and download the SQL Agent CLI installer for your operating system (Windows .exe, macOS .pkg, or Linux .deb/.rpm). Run the installer and follow the prompts. Verify installation by opening your terminal and running sql-agent --version.

2

Get Your License Key

Choose a subscription plan from our pricing page. The Free tier lets you start immediately with limited queries. After purchase, you'll receive your license API key via email and in your account cabinet.

3

Activate Your License

Open your terminal and run sql-agent login YOUR-LICENSE-KEY (replace YOUR-LICENSE-KEY with your actual key). SQL Agent will encrypt and store your credentials locally. You only need to do this once per device.

4

Configure AI Provider

SQL Agent needs an AI provider for natural language to SQL conversion. Set your OpenAI API key with export OPENAI_API_KEY=your-key (or use Anthropic, Groq, or local Ollama). For local offline operation, install Ollama and run sql-agent configuration llm.provider --value ollama.

5

Connect to Your Database

Connect to your PostgreSQL, MySQL, or SQLite database using sql-agent connect --url "database-url". Examples: postgresql://user:pass@localhost:5432/mydb for PostgreSQL, mysql://user:pass@localhost:3306/mydb for MySQL, or sqlite:///path/to/database.db for SQLite.

6

Start Querying with Natural Language

Type your question in plain English, such as "Show me all users", "What's the total revenue?", or "List products ordered by price". Press Enter and SQL Agent will generate and execute the SQL query, displaying results in a formatted table. Type schema to see all tables, history to view past queries, or help for all commands.

Pro Tip: Start with read-only mode (default) when exploring production databases. Once comfortable, enable write mode with the --write flag to perform INSERT, UPDATE, and DELETE operations.

Advanced Usage for Power Users

SQL Agent CLI offers powerful advanced features for experienced developers, database administrators, and data analysts who need more control and automation in their database workflows.

Database Profiles

Save frequently-used database connections as profiles for instant access. Run sql-agent save-profile production --url "your-db-url", then connect anytime with sql-agent use-profile production. Perfect for managing dev, staging, and production database connections.

Query History & Replay

SQL Agent automatically tracks all executed queries with timestamps. Type history to view recent queries, then re-run any query by its number. Export query history for documentation, auditing, or sharing with team members. Useful for reproducing analysis or debugging query issues.

Controlled Write Operations

Enable database modifications with --write flag. SQL Agent will confirm destructive operations before execution. Use natural language for data manipulation: "Add a new user with email test@example.com", "Update product prices by 10%", or "Delete orders older than 2 years". All write operations require explicit confirmation.

Schema Analysis & Insights

Use schema to view all tables and columns, or insights table_name to get detailed statistics including row counts, column distributions, null percentages, and sample data. Invaluable for exploring unfamiliar databases or understanding data quality issues.

Custom AI Model Configuration

Switch between AI providers and models based on your needs. Configure with sql-agent configuration llm.provider --value [openai|anthropic|groq|ollama] and sql-agent configuration llm.model --value model-name. Balance cost, speed, and accuracy by choosing the right model for each task.

Fully Offline Operation

For air-gapped environments or secure networks, run SQL Agent completely offline using local Ollama models. Install Ollama, download a model like Llama 2 or CodeLlama, then configure SQL Agent to use it. Enable safe license mode with sql-agent configuration license_fail_mode --value safe for offline license validation.

Enterprise Feature: Professional and Enterprise plans unlock additional advanced features including performance analysis, query optimization suggestions, and team collaboration tools. See our pricing page for details.

Still have questions?

We're here to help! Reach out to our team for personalized assistance.

Get SQL Help Now