Natural Language → SQL
Generates one dialect-correct statement from a natural-language question, grounded on the live schema (names, types, nullability) of the connected database. Works across all supported dialects.
Inputs
- Connection (required), schema is introspected before generation.
- Question (required), the natural-language ask.
Output
{ sql: 'SELECT ... FROM ... WHERE ...;' }
The model is constrained to a single statement, no markdown fencing, semicolon-terminated. When the question is unanswerable from the schema it returns a one-line SQL comment (-- prefix) explaining why, rather than hallucinating tables.
Running a generated query
Each reply carrying SQL exposes two actions:
- Run, loads into the editor and executes against the selected connection in one click. Honors IDE safety settings ("Confirm before execute", "Block destructive statements", statement timeout) and, like Insert, refuses destructive ops (DROP/TRUNCATE/DELETE-without-WHERE, etc.).
- Insert into Editor, stages the SQL without running, for review or edit first.
Settings → Query execution & safety → Auto-run AI queries collapses the click: non-destructive generated SQL executes the moment it returns. Destructive statements stay blocked; confirm-before-execute and timeouts still apply.
Context bound
The serializer caps at 50 tables per prompt (alphabetic by schema then name) to bound token usage. Beyond that, narrow the question or pre-select a schema so the relevant tables land in context.