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.
11 work today. ORDER BY, HAVING, window functions, and UPDATE via /sql all execute now. A few remain limited or on the roadmap (DELETE via /sql translates only, recursive CTEs, UNION) - 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.
ORDER BY (asc/desc), LIMIT and OFFSET all execute through the SQL translator today.
ROW_NUMBER and RANK with OVER (PARTITION BY ... ORDER BY) execute today. Explicit ROWS frames are still roadmap.
Uncorrelated and correlated subqueries both execute - IN (SELECT), EXISTS / NOT EXISTS, and scalar forms.
UPDATE executes against the engine and returns rows_affected. (Earlier builds only translated.)
DELETE through /sql returns the translated delete (the pk it would remove) but does NOT execute it today.
Recursive CTEs are not yet supported. For hierarchy walks, use graph endpoints instead.