Skip to main content

Module relational

Module relational 

Source
Expand description

Parameterized SQL lowering shared by the three relational backend adapters. Connection, isolation, error mapping, and migration execution remain with the SQLite, PostgreSQL, and MySQL adapter crates.

Structsยง

Builder ๐Ÿ”’
ReservationStatements
Prepared statements for one reservation decision under a backend transaction.
Statement
One safely parameterized statement; values never enter its SQL text.

Enumsยง

Dialect
The physical placeholder and identifier convention selected by an adapter.

Functionsยง

adoption_cursor
Extracts the next stable identity cursor from a bounded adoption page.
column
Produces one physical column declaration without accepting raw SQL.
compile_aggregate
Compiles one count, sum, minimum, or maximum over declared fields.
compile_claim_select
Compiles an ordered, one-record claim selection with backend row locking.
compile_delete_effects
Keeps JSON relationship values synchronized when native constraints null their keys. The caller executes these bounded statements in the same transaction as deletion.
compile_detached_delete_effects
Lowers referential delete actions when an adapter temporarily detaches native constraints. Descendants are removed before their parents; the adapter verifies restrictive references before committing. Every predicate retains the ordinary typed parameter bindings.
compile_ensured_identity_query
Looks up the identity of an inserted or pre-existing unique record inside the same transaction. The caller must hold its transaction until this read.
compile_mutation
Compiles one validated transaction step against previous generated IDs.
compile_query
Compiles one bounded logical query to parameterized SQL.
compile_reservation
compile_schema_change
Compiles one additive logical migration step into SQL statements. The executing adapter must guard these statements with its migration ledger.
conditional_index ๐Ÿ”’
Compiles one declared conditional or case-folded index.
current_timestamp_sql
Keeps generated timestamps consistent in inserts, schema defaults and backfills.
ddl_field_literal ๐Ÿ”’
ddl_filter ๐Ÿ”’
Encodes a schema-owned partial-index condition without request interpolation.
ddl_literal ๐Ÿ”’
Encodes a schema-owned literal in DDL; request values never use this path.
derived_adoption_query
Builds an ordered, bounded migration page for expression-key adoption.
derived_adoption_statements
Repairs expression keys from a locked migration page without changing original values.
derived_column
Declares a nullable physical key whose Unicode mapping is owned by Rust.
derived_field
Describes a protected comparison column for creation and interrupted-DDL verification.
expression_index ๐Ÿ”’
Lowers an index with an explicit physical encoding; runtime writes use protected keys.
field_copy_query
Selects one bounded page for a typed field-copy migration.
field_copy_statements
Uses ordinary typed mutation lowering for historical copy values and derived keys.
field_default_sql
Lowers one declared default for schema creation and physical storage adoption.
foreign_key_clause ๐Ÿ”’
Emits a MySQL table constraint because inline REFERENCES does not enforce it.
previous_expression_index
Describes the retired native-lowercase encoding solely for validated storage adoption.
record_values
Resolves logical record fields to safe SQL bind values before import.
resolve_value ๐Ÿ”’
Resolves a transaction-local value from a previous insert result.
sql_type
Maps a logical field to one backend-specific physical scalar type. Returns the physical field declaration used by schema creation and catalog verification.