pub trait Dialect:
Send
+ Sync
+ 'static {
const AUTO_PK: &'static str;
const INSERT_IGNORE: &'static str;
const CONFLICT_NOTHING: &'static str;
const COLLATE_NOCASE: &'static str;
const EPOCH_NOW: &'static str;
// Required methods
fn ilike(col: &str) -> String;
fn epoch_from_col(col: &str) -> String;
}Expand description
Required Associated Constants§
Sourceconst AUTO_PK: &'static str
const AUTO_PK: &'static str
Auto-increment primary key DDL fragment.
SQLite: INTEGER PRIMARY KEY AUTOINCREMENT
PostgreSQL: BIGSERIAL PRIMARY KEY
Sourceconst INSERT_IGNORE: &'static str
const INSERT_IGNORE: &'static str
INSERT OR IGNORE prefix for this backend.
SQLite: INSERT OR IGNORE
PostgreSQL: INSERT (pair with CONFLICT_NOTHING suffix)
Sourceconst CONFLICT_NOTHING: &'static str
const CONFLICT_NOTHING: &'static str
Suffix for conflict-do-nothing semantics.
SQLite: empty string (handled by INSERT OR IGNORE prefix)
PostgreSQL: ON CONFLICT DO NOTHING
Sourceconst COLLATE_NOCASE: &'static str
const COLLATE_NOCASE: &'static str
Case-insensitive collation suffix for ORDER BY / WHERE clauses.
SQLite: COLLATE NOCASE
PostgreSQL: empty string (use ILIKE or LOWER() instead)
Required Methods§
Sourcefn ilike(col: &str) -> String
fn ilike(col: &str) -> String
Case-insensitive comparison expression for a column.
SQLite: {col} COLLATE NOCASE
PostgreSQL: LOWER({col})
Sourcefn epoch_from_col(col: &str) -> String
fn epoch_from_col(col: &str) -> String
Epoch seconds expression for a timestamp column.
Wraps the column in the backend-specific function that converts a stored
timestamp to a Unix epoch integer, coalescing NULL to 0.
SQLite: COALESCE(CAST(strftime('%s', {col}) AS INTEGER), 0)
PostgreSQL: COALESCE(CAST(EXTRACT(EPOCH FROM {col}) AS BIGINT), 0)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.