AI2SQL is an AI SQL assistant for engineers and analysts, with the core goal of working on real database schemas rather than guessing from generic examples. Users describe their needs in natural language, and AI2SQL generates SQL in the corresponding dialect based on the connected database, using real table and column names, and can directly execute it in read-only mode and return result rows.
Main capabilities
- Text to SQL: Describe the desired result in English and generate a query matching real table names, column names, and the database dialect.
- Explain query: Provide a plain-language explanation of existing SQL clause by clause, making it easier to understand queries left behind by others.
- Fix errors: Correct syntax errors, dialect mismatches, and column name errors, and explain the cause of the errors.
- Optimize performance: Rewrite slow queries and give reasons, such as joins that should have been filter conditions, missing indexes, etc.
- Execute queries: After connecting to a read-only database, you can run them directly and view the returned rows.
- Formatting: Standardize casing, indentation, and line breaks for easier PR submission.
- Query library: Teams can share and reuse queries.
- AI agent access: Provides governed MCP endpoints and a REST API, supporting Claude Code, Claude Desktop, Cursor, ChatGPT (developer mode), and custom agents to query the database.
How to use
- Select a database, or use the demo database in the free plan.
- Describe the desired result in natural language.
- AI2SQL generates SQL in the dialect of the selected database, using real table and column names.
- You can execute it read-only to view results, or use the explain, fix, and optimize features on any pasted query.
- Connecting to a database requires read-only credentials, and credentials are stored encrypted.
Supported data sources PostgreSQL, MySQL, SQL Server, Oracle, Snowflake, BigQuery, Amazon Redshift, MongoDB, SQLite, Firebird.
Security and governance Connections are read-only by default. sqlGuard classifies statements before they reach the database, blocking write operations such as INSERT, UPDATE, DELETE, and DROP, as well as DDL, multi-statement input, and functions that read server files. Every query is logged, and keys can be scoped per agent and revoked at any time. The MCP gateway enforces read-only access, rate limiting, and full auditing.
Desktop connector The AI2SQL Connector can run where the database is located, supporting Windows, macOS, and Linux, used to connect to MySQL, PostgreSQL, and SQL Server on localhost or private addresses, credentials never leave the local machine, no need to open ports or tunnels, log in with an existing AI2SQL account.
Use cases
- Quickly generate queries when you know the question but are not sure how to join tables.
- When taking over a query whose origin no one remembers, understand it first before running it.
- When a query runs but is very slow, get a rewritten version and the rationale for optimization.
- When a query cannot run, fix syntax, dialect, and column name issues.
- Let AI agents access database data in a governed read-only way.
- Analysts and learners learn SQL by mapping their own questions to SELECT, JOIN, GROUP BY.
Limitations and cautions
- Generated SQL should be checked for table names, column names, joins, filter conditions, and execution plans just like reviewing a colleague's PR.
- For a one-off query that can be pasted into a chat box, there is not much difference from a general assistant; the difference shows in scenarios that require a live database.
- Query generation itself requires connecting to its API.
- The free plan allows 3 queries per day, limited to demo databases; connecting your own database requires a Pro or Team plan.
Pricing A 7-day free trial is offered, charged $0 today, but a bank card must be linked, and it can be canceled with one click before the trial ends. Paid plans: Start $9/month, Pro $19/month, Team $39/month; billed annually they are $7/month, $14/month, $29/month respectively. Start includes 100 queries per month, basic generation, query explanation, syntax error fixing; Pro includes unlimited queries, advanced AI models, query optimization and explanation, database connectors, desktop app (Windows and Mac), priority support; Team includes all Pro features, 5 users, shared query library, role-based access control, execution priority, advanced analytics. Prices are in USD.