community-automations/sql-schema-to-query

研究與情報

PublicClaude 子代理

Schema → SQL

把範例資料列餵給模型來產生 SQL,既會洩露資料,還是會憑空捏造欄位名稱。這套自動化流程只根據 schema 運作。

sonnet3 天PostgresOpenAISQLGlotPython
ClaudeClaude
ROI for
README.md

為什麼選擇此子代理

把範例資料列餵給模型來產生 SQL,既會洩露資料,還是會憑空捏造欄位名稱。這套自動化流程只根據 schema 運作。

它會接收你的資料表與欄位定義、草擬查詢,再加以解析,確認每個被引用的欄位都確實存在後,才回傳任何結果。任何資料列都不會傳到模型。你會拿到一個乾淨、有效的查詢,外加它所依賴的資料表與 join 清單。

運作方式

    • Read

      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.

輸出範例

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.