SynthQL
- Year
- 2024
- Role
- Design and engineering
- Status
- Live

Start with the question
SynthQL turns a plain-English request into SQL. I built a form that keeps the prompt, optional schema and generated result together, with a copy action for using the query in another tool.
How it works
A Next.js route sends the prompt to Text2SQL.ai with a server-held credential and requests the MySQL dialect.
Next.js API route
The Next.js route keeps the provider key on the server and returns generated SQL or an error payload. Stronger validation and provider timeouts remain follow-up work.
All implementation notes
Query generation
- Prompt form
- The form collects a question and optional schema text. Schema input is manual; the app does not introspect a connected database.
- Next.js API route
- The Next.js route keeps the provider key on the server and returns generated SQL or an error payload. Stronger validation and provider timeouts remain follow-up work.
- Text2SQL.ai
- Text2SQL.ai generates a MySQL query from the supplied context. SynthQL displays it for review and copying; it never executes it.
- Prompt form: posts the generation request (Next.js API route).
- Next.js API route: forwards prompt and optional schema, then returns SQL (Text2SQL.ai).
Engineering decisions
- Schema is supplied deliberately. You can enter table and column definitions; the app does not connect to a database to discover them.
- Generation stops at review. The result is SQL to inspect and copy. SynthQL never executes it against a database.
- Keep the prototype’s limits visible. Provider failures return an error payload. Timeouts, stronger validation and more specific errors remain useful follow-up work.
Try SynthQL (opens in a new tab) or browse the source (opens in a new tab).