Expand description
The SQL h5i-app runs on PostgreSQL.
compile turns an h5i_app_sql::Stmt into a Query over a small SQL
subset (Sql); render prints it. Extracted to Lean (proofs/): a
compiled statement matches H5iAppLib.Sql.exec on the tenant’s rows and
leaves other tenants alone.
Aeneas subset: no ?, no String, no iterator adapters.
Structs§
- ColDef
- A column definition in
CREATE TABLE. - Column
- A column of a tenant table.
- Query
- A statement and the values of its parameters,
$1first. - Table
- A tenant table:
tenant_id, thencolumns. Key:tenant_idand the firstkey_lencolumns.
Enums§
- Cond
- A
WHEREcondition;$paramcounts from 1. - Kind
- A column type.
- Sql
- A statement of the subset. Names are printed quoted.
Functions§
- compile
- The query that runs
sfortenant.Noneon a bad schema, a missing table, or values that do not fit.DeleteandDeleteWhereneed key columns: a keyless table holds one row, which is only replaced. - create
CREATE TABLEfort.- render
- The text of
s, as sent to PostgreSQL. - select
- The tenant’s rows of
table(notenant_id), optionally filtered bycol IS NOT DISTINCT FROM val.Noneon a bad schema, table, column, or type. - tenant_
col tenant_id, the first column of every table.- valid
- Tables well formed with distinct names; no
tenant_idcolumn, noh5i_table.