SQL examples
← All examples13 SQL examples, each on its own page. Every example has the schema TOML it needs, a pre-seed insert, side-by-side cURL / Python / TypeScript / Go, the response shape, and notes on common mistakes.
8 work today. A few examples document features that are still on the roadmap (ORDER BY, HAVING, window functions, CTEs) - the page tells you what works now and how to work around the gap.
Project specific columns from a single table. Read only the fields you need.
Equality predicate. The planner promotes it to an IndexScan when an index covers the column.
Match against a small set of literal values. Folded into a disjunction over equalities.
Range predicate on a numeric or string column. Inclusive on both bounds.
Combine rows that have a match on both sides. Hash-join on the equality.
Every row from the left side, plus matches from the right (null if no match).
Multiple aggregates in one pass. The hash aggregator buckets on the GROUP BY key.
LIMIT caps result count. ORDER BY through the SQL translator is on the roadmap.
ROW_NUMBER, RANK, LAG, LEAD - not yet supported. Compute rankings client-side.
The supported subquery shape - inner SELECT doesn't reference outer. Correlated forms are not supported.
/sql translates UPDATE into a typed payload but doesn't execute. For real writes, use /rows endpoints.
Same caveat as UPDATE - /sql returns a translation. Use /rows/:schema/:pk to actually delete.
Recursive CTEs are not yet supported. For hierarchy walks, use graph endpoints instead.