Sql

SQL syntax & examples

/ Sql

SQL syntax & examples #

The /_sql frontend accepts a SQL-92-shaped SELECT subset with Pizza extension functions. This page walks it clause by clause, with runnable examples — every shape below is covered by the gateway’s end-to-end tests. See SQL & PRQL for the wire contract and the response envelope, and PRQL queries for the pipeline frontend.

Statements are case-insensitive (SELECT = select), -- starts a line comment, and the overall shape is:

...

PRQL queries

/ Sql, / Prql

PRQL queries #

POST /_prql accepts PRQL pipeline text in the same request shape as POST /_sql — query, plus cursor, params, snapshot_id and timeout riding alongside exactly as they do for SQL. The statement is compiled by a pinned prqlc and executed as its equivalent SQL through the identical pipeline, so cursors, snapshots, timeouts and the response envelope behave the same (see SQL & PRQL).

A cursor walk resubmits the SAME PRQL text plus the cursor object; the compiled statement is cached by text, so the walk compiles once.

...