Back to templates
Template

text-to-sql-query-builder

Use when the user asks an agent (in a code or data repo) to translate a natural-language question into dialect-correct SQL with a machine-checkable rationale. The workflow has the agent discover schema and dialect from the repo before asking the user, drafts the query plus a structured rationale, then runs five programmatic verifiers (parse, explain, column-match, rationale-coverage, write-guard). Use when an agent must answer questions like "top 10 customers by revenue last 30 days" against a known schema.

Outcome

Produce a SQL query and a structured rationale that pass parse, explain, column-match, rationale-coverage, and write-guard verifiers, after the agent discovers schema and dialect from repo context.

Metadata
Identifier
@randalolson/text-to-sql-query-builder
Version
v1
Published
May 5, 2026
Template body is not shown on this page. Fetch the runbook through Goodeye.