Expand description
Dialect-agnostic SQL primitives shared by the Postgres (cratestack-sqlx)
and SQLite (cratestack-rusqlite) backends.
This crate carries the type definitions every backend agrees on:
SqlValue/SqlColumnValue— value envelopes used to bind dataCreateModelInput/UpdateModelInput/UpsertModelInput— traits the codegen emitsFilter/FilterExpr/FieldRef— query ASTOrderClause/SortDirection— ordering ASTModelDescriptor/ModelColumn/CreateDefault— schema metadata baked into compiled code byinclude_schema!
Rendering SQL strings, executing queries, and any DB-driver coupling live in the backend crates.
Structs§
- Create
Default - Field
Ref - Filter
- Model
Column - Model
Descriptor - Order
Clause - Postgres
Dialect - Postgres dialect —
$Nplaceholders. - Relation
Filter - SqlColumn
Value - Sqlite
Dialect - SQLite dialect —
?Nplaceholders.
Enums§
Traits§
- Create
Model Input - Dialect
- Backend SQL dialect.
- Into
SqlValue - Update
Model Input - Upsert
Model Input - Input shape for the upsert primitive —
INSERT … ON CONFLICT (<pk>) DO UPDATE ….sql_values()must include the primary-key column (so the backend can target the conflict), andprimary_key_value()exposes the PK separately so the runtime can issue aSELECT … FOR UPDATEbefore the upsert to driveCreatedvs.Updatedevent / audit semantics.