{"slug":"api-sitecheck-api-workers-dev-api-sql-generate-d85dc9","title":"SQL from a question and a schema (CREATE TABLE statements or a JSON description ","host":"api.sitecheck-api.workers.dev","method":"POST","resource":"https://api.sitecheck-api.workers.dev/api/sql/generate","category":"other","description":"SQL from a question and a schema (CREATE TABLE statements or a JSON description of tables and columns), for postgres (default), mysql, sqlite or bigquery. The tables and columns used are checked against the schema; a query that does not match it is retried once, then refused. Writes (INSERT, UPDATE,","price_listed":0.003,"price_asked":null,"state":"effects","state_label":"Not tested: has real-world effects","checks_7d":0,"answered_7d":0,"latency_ms_median":null,"reported_calls_30d":2,"reported_payers_30d":2,"networks":["eip155:5042","eip155:8453","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"dialect":"postgres","question":"How many orders were placed in 2025?","schema":"CREATE TABLE orders (id integer primary key, placed_at timestamp, total numeric(10,2));"},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"properties":{"allowWrite":{"description":"Allow INSERT, UPDATE, DELETE or DDL (default false)","type":"boolean"},"dialect":{"description":"postgres (default), mysql, sqlite or bigquery","type":"string"},"question":{"description":"Question in plain language (max 1,000 characters)","type":"string"},"schema":{"description":"CREATE TABLE statements, or a JSON object of tables and column lists (max 20,000 characters)","type":"string"}},"required":["question","schema"]},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[],"description_full":"SQL from a question and a schema (CREATE TABLE statements or a JSON description of tables and columns), for postgres (default), mysql, sqlite or bigquery. The tables and columns used are checked against the schema; a query that does not match it is retried once, then refused. Writes (INSERT, UPDATE, DELETE, DDL) are refused unless allowWrite is true. The query is not run.","last_updated":"2026-10-16T07:33:28.925Z","schemes":["exact"]}