Expand description
Evaluation of table/column check constraints.
Kit check constraints are stored as serializable expression strings (the TypeScript kit uses JS functions at the API layer, but the conformance fixtures and cross-language schema serialize a string grammar). This module implements a small, deterministic evaluator for that grammar so Rust, Python, and TypeScript enforce the same constraints.
Supported grammar:
expr := or_expr
or_expr := and_expr ( ("OR" | "||") and_expr )*
and_expr := not_expr ( ("AND" | "&&") not_expr )*
not_expr := ("NOT" | "!") not_expr | atom
atom := "(" or_expr ")" | comparison
comparison := operand OP operand
operand := column | number | string | bool | null
OP := "=" | "==" | "!=" | "<>" | "<" | "<=" | ">" | ">="Evaluation follows SQL three-valued logic: a check is only violated when it
evaluates to a definite false. NULL/unknown comparisons pass.
Structs§
- Check
Parse Error - Error produced when a check expression cannot be parsed.
Functions§
- eval_
check - Evaluate a check expression against a row.