AI text to SQL
Ask a question in plain words, get SQL for your schema and your database dialect.
Your key stays in your browser.It goes straight to the provider, never to our servers, and we neither log nor keep it. Use a dedicated key with a spending cap, and delete it in the provider's dashboard when you are done.
Input
Result
The result will appear here.Describe what you want to know — "revenue per month from paid orders, newest first" — paste your CREATE TABLE statements into the schema box, and choose PostgreSQL, MySQL, SQLite, SQL Server, BigQuery or Oracle. You get one query written for that dialect, a short explanation of the joins and filters, and a list of any assumptions. The approach follows text-to-SQL projects such as Canner/WrenAI: ground the query in the real schema, never invent a column, and say plainly when the schema cannot answer the question.
How it works
- The dialect choice also pins a version — PostgreSQL 14+, MySQL 8, SQL Server 2019, Oracle 19c — so the model uses functions that really exist there.
- Without a schema it still answers, but lists the table and column names it had to assume so you can map them to yours.
- Queries are read-only SELECTs unless you explicitly ask to change data; then a warning comes first and the statement is wrapped in a transaction.
Where your data goes
With your own key, what you type and the key go from your browser straight to the provider you choose; neither passes through Hysen Labs. In hosted mode, your text goes through our server to our provider (DeepSeek) and is billed in credits; we keep the token counts and cost of each run for billing, never the text itself or the answer. How the provider handles the text is governed by its own privacy policy.
This tool handles keys and credentials, so nothing about a run is saved, not even to your own history.
About your API key
We do not collect, store or leak your key: it lives only in this page's memory (unless you tick “remember in this tab”) and is gone when you close it. Still, treat any key you have pasted into a web page with care — create a dedicated key with a spending cap for use here, and delete or rotate it in your provider's dashboard when you are done.
What it costs
This tool is free, with no sign-in and no points.
Common questions
- Is it safe to paste my database schema?
- The schema goes from your browser to the AI provider you picked, with your key, and nowhere else. Table definitions rarely contain data, but they do reveal structure, so use a provider you trust and a dedicated key you can delete afterwards. Never paste rows of customer data.
- What format should the schema be in?
- CREATE TABLE statements work best — pg_dump --schema-only, SHOW CREATE TABLE in MySQL, or .schema in SQLite give you them. A plain list of tables and columns also works; include foreign keys and comments, because they tell the model how tables join.
- Can I run the generated SQL directly?
- Read it first and test on a copy or with LIMIT. Check the date range — the prompt uses half-open ranges and states whether "last month" meant the calendar month — and check NULL handling. The model cannot see your data, so a query can be valid SQL and still count the wrong thing.
The open-source behind it
This tool is a self-contained implementation. Canner/WrenAI (Apache-2.0) does the same job as a library — if you need this behaviour inside your own program, start there rather than calling a web page.
Canner/WrenAIAlso known as
- text to sql
- ai sql generator
- natural language to sql
- sql query generator ai
- chatgpt sql