Skip to main content

Crate h5i_app_pgsql

Crate h5i_app_pgsql 

Source
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, $1 first.
Table
A tenant table: tenant_id, then columns. Key: tenant_id and the first key_len columns.

Enums§

Cond
A WHERE condition; $param counts from 1.
Kind
A column type.
Sql
A statement of the subset. Names are printed quoted.

Functions§

compile
The query that runs s for tenant. None on a bad schema, a missing table, or values that do not fit. Delete and DeleteWhere need key columns: a keyless table holds one row, which is only replaced.
create
CREATE TABLE for t.
render
The text of s, as sent to PostgreSQL.
select
The tenant’s rows of table (no tenant_id), optionally filtered by col IS NOT DISTINCT FROM val. None on 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_id column, no h5i_ table.