All tools

Text to SQL Generator (AI)

Code

Describe the data you want in plain English, optionally paste your CREATE TABLE schema, and get a ready-to-run SQL query with an explanation and the assumptions it made, powered by Claude

Loading tool…
Was this tool helpful?
sqlquerydatabasegeneratortext-to-sqlpostgresmysqlaiclaude

About Text to SQL Generator (AI)

Type a question like "top 10 customers by revenue in the last 90 days" and get back a formatted SQL query, a short explanation of how it answers the question, and a list of the assumptions it had to make, such as which column means "revenue". Paste your CREATE TABLE statements (or a plain list of tables and columns) and it will only use names that exist in that schema, which is the difference between a query you can run and one you have to rewrite. Pick a dialect (Postgres, MySQL, SQLite, SQL Server, Oracle, BigQuery, Snowflake) to get the right date functions, LIMIT/TOP syntax and identifier quoting. Every result is also checked by plain code, not the model, for INSERT, UPDATE, DELETE, DROP and other write statements, and for an UPDATE or DELETE with no WHERE clause, so a destructive query is always flagged before you copy it.

How to use Text to SQL Generator (AI)

  • 1.Write your question in plain English, for example "monthly signups in 2026 split by plan".
  • 2.Paste your schema (CREATE TABLE statements from pg_dump --schema-only, SHOW CREATE TABLE or a migration file) and choose your dialect, then click Generate.
  • 3.Read the assumptions and warnings, then run the query against a development copy or inside a transaction before trusting it on production data.

Frequently asked questions

Does it connect to my database?
No. It only sees the question and the schema text you paste. Nothing is executed, so check the query yourself before running it.
Where is my question and schema sent?
Both are sent to Anthropic's API (Claude, with OpenAI as a fallback) to generate the query. Paste table and column definitions only, never real rows or credentials.
Why should I paste a schema?
Without one the model has to guess table and column names, and it lists those guesses under assumptions. With a schema it is told to use only the tables and columns you defined, which makes the query far more likely to run as-is.
Can it write UPDATE or DELETE statements?
Only when your question explicitly asks to change data. Any write or schema statement gets a warning, and an UPDATE or DELETE with no WHERE clause gets a second one, because it would touch every row.

Use via API, SDK, or MCP

cURL# Free: a few generations/month · Pro: more per month
curl -X POST api.utilix.tech/v1/ai/text-to-sql \
  -H "Authorization: Bearer utx_live_..." \
  -H "Content-Type: application/json" \
  -d '{"prompt": "..."}'

Free plan includes a monthly quota; Pro raises the limit. Get an API key from your dashboard · Full API docs →