Generating SQL by feeding sample rows to a model leaks data and still hallucinates column names. This automation works from the schema alone.
sonnet3 daysPostgresOpenAISQLGlotPython
Claude
53ROI
73Scale
$2k91Saved
ROI for
README.md
Why this subagent
Generating SQL by feeding sample rows to a model leaks data and still hallucinates column names. This automation works from the schema alone.
It takes your table and column definitions, drafts the query, then parses it to confirm every referenced field actually exists before returning anything. No row data ever reaches the model. You get a clean, valid query plus the list of tables and joins it relies on.
How it runs
Used at step 01 to kick off the pipeline.
Write
Used at step 01 to kick off the pipeline.
WebFetch
Used at step 01 to kick off the pipeline.
WebSearch
Used at step 01 to kick off the pipeline.
Generate a candidate SQL query from the request using just that schema context.
pending
Parse the query with SQLGlot to confirm it references only existing columns and is syntactically valid.
pending
Return the validated query along with the list of tables and joins it uses.
pending
Sample output
json
// Sample output
// (generated when the pipeline finishes)
Given only a database schema, produce a syntactically valid SQL query that references existing columns and no invented fields.
Unlock the rest
The full agent definition, install snippet, and starter task are gated for community members.
Members get the full `.md` agent file, the npm / pnpm install one-liners, a starter prompt that we've tuned against real runs, and the open-source repo when this automation ships there. One email, magic link, done.