Skip to main content

Module dialect

Module dialect 

Source
Expand description

SQL dialect: the points where SQL flavors genuinely diverge.

The sync engine is storage-agnostic: it builds SQL as strings and runs them through a backend connection. The few places where SQL flavors actually differ — placeholder syntax, scalar-max function, collation, and type names (via DbType::sql_type) — are captured here as a closed SqlDialect enum.

A dialect is a property of the SQL flavor, not the driver: rusqlite, D1, and Durable Objects are three backends but all speak SqlDialect::Sqlite. Backend crates (ubiquisync-sqlite, ubiquisync-postgres) therefore don’t implement a dialect — they only report which one they are. Centralizing the divergences here keeps every cross-flavor difference in one auditable place.

Structs§

PlaceholderGen
Hands out positional bind placeholders in sequence (?1/$1, ?2/$2, …) for the given dialect, so a query builder doesn’t track indices by hand.

Enums§

SqlDialect
The SQL flavor a backend speaks.