pub enum SqlDialect {
Sqlite,
Postgres,
}Expand description
The SQL flavor a backend speaks.
Variants§
Implementations§
Source§impl SqlDialect
impl SqlDialect
Sourcepub fn placeholder(&self, n: usize) -> String
pub fn placeholder(&self, n: usize) -> String
Renders a positional bind placeholder for parameter n (1-based):
?n on SQLite, $n on Postgres.
Sourcepub fn scalar_max(&self) -> &'static str
pub fn scalar_max(&self) -> &'static str
Scalar two-argument max function: MAX on SQLite, GREATEST on
Postgres. Callers must keep the COALESCE wrapping around the
arguments — SQLite’s MAX returns NULL if any argument is NULL
while Postgres’s GREATEST ignores NULLs; the COALESCE is what makes
both backends merge identically. Do not simplify it away.
Sourcepub fn text_collate(&self) -> &'static str
pub fn text_collate(&self) -> &'static str
Collation suffix appended to text comparisons that must order
bytewise (the LWW value-byte tiebreak, pull-sync cursor iteration).
Empty on SQLite (TEXT already compares with BINARY collation);
COLLATE "C" on Postgres, whose default collation is locale-aware.
Sourcepub fn without_rowid(&self) -> &'static str
pub fn without_rowid(&self) -> &'static str
CREATE TABLE suffix that stores the table clustered by its primary key
instead of a synthetic row id: WITHOUT ROWID on SQLite, empty on Postgres.
Sourcepub fn null_safe_eq(&self) -> &'static str
pub fn null_safe_eq(&self) -> &'static str
Null-safe equality operator: IS on SQLite, IS NOT DISTINCT FROM on
Postgres. Both are infix (a <op> b) and treat two NULLs as equal —
unlike =, which yields NULL when either side is NULL.
Trait Implementations§
Source§impl Clone for SqlDialect
impl Clone for SqlDialect
Source§fn clone(&self) -> SqlDialect
fn clone(&self) -> SqlDialect
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SqlDialect
Source§impl Debug for SqlDialect
impl Debug for SqlDialect
impl Eq for SqlDialect
Source§impl PartialEq for SqlDialect
impl PartialEq for SqlDialect
Source§fn eq(&self, other: &SqlDialect) -> bool
fn eq(&self, other: &SqlDialect) -> bool
self and other values to be equal, and is used by ==.