Metakit / API
@doeixd/metakit/sql
SQL text for Postgres and SQLite (@doeixd/metakit/sql): a Schema's rules as a
CHECK, a boolean expression as a WHERE predicate with its parameters,
and a transition as a guarded UPDATE.
The lowering itself is sqlLowering.ts, which @doeixd/metakit/drizzle renders
too; this module renders its pieces as text.
Functions
lowerNode | Lower node, reading a path under rowPrefix as a column. The root path (Path.root()) reads every path as a column. |
relatedSubquery | A correlated subquery over the related rows, in a renderer's form of SQL: from is their table, matches says a row points at the row asked of, and an element… |
target | A SQL target for Language.readiness and Tooling.explain that also asks of a transition what toUpdate asks, through its own lowering, with every path read as… |
toCheck | Every rule of schema as a SQL CHECK (...) clause. The check fails where a rule is unknown of a null, as the Schema refuses that value. Literals are written… |
toUpdate | A Transition and one input as a guarded, parameterized SQL UPDATE of table: it writes only the rows the guard holds of and whose step does not refuse, each… |
toValue | An Expr as a parameterized SQL value, for a SELECT list: null is NULL, a boolean stays apart from null, and a refusal is NULL or an error the database… |
toWhere | A boolean Expr as a parameterized SQL WHERE predicate. Only true keeps a row. Where an enclosing operator could read refusal as a value, lowering tests for… |
Values
Classes
Interfaces
ClaimOptions | What lets toUpdate write the result of a custom operation: its claims.total, read only under a rewrite policy, as every reader of a claim reads it… |
RelationTable | Where the rows related to a row through a relation are: their table, the column of it that holds the id of the row they point at, and the column of the… |
SqlContext | |
SqlFragment | A statement or a term of one, and the values it binds in the order its placeholders take them. |
SqlOptions |
Types
ColumnName | How a path under the row becomes SQL for its column; the default quotes its segments joined by _. |
RelatedFold | The folds SQL asks of related rows: the others answer in an order, or with a list. |
RelationTables | The table of each relation a Rows node over related rows names, as [relation, table] pairs. A relation listed twice throws. |
Sql | Lowered SQL: its pieces in the order they are written. |
SqlDialect | |
SqlLowerer | |
SqlParam | A value a statement binds, as the driver of D takes it: on SQLite a number or text (a boolean is bound as 1 or 0, a list as JSON text read through json(?)),… |