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

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:

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.