pub struct SqliteDialect;Trait Implementations§
Source§impl Dialect for SqliteDialect
impl Dialect for SqliteDialect
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Short name for log messages and errors (e.g. “postgres”, “mysql”, “sqlite”).
Source§fn ddl_type(&self, t: &CanonicalType) -> String
fn ddl_type(&self, t: &CanonicalType) -> String
DDL type string for CREATE TABLE (e.g. “TIMESTAMPTZ”, “DATETIME”, “TEXT”).
Source§fn cast_name(&self, _t: &CanonicalType) -> Option<String>
fn cast_name(&self, _t: &CanonicalType) -> Option<String>
Type name used in parameter cast expressions, or
None when no cast is needed.
Postgres: becomes $n::cast. MySQL/SQLite: cast is omitted (binding handles type).Source§fn type_category(&self, t: &CanonicalType) -> TypeCategory
fn type_category(&self, t: &CanonicalType) -> TypeCategory
Broad category for RSQL operator validation.
Source§fn type_support(&self, t: &CanonicalType) -> TypeSupport
fn type_support(&self, t: &CanonicalType) -> TypeSupport
How well this dialect supports the canonical type.
Source§fn quote_ident(&self, s: &str) -> String
fn quote_ident(&self, s: &str) -> String
Wrap an identifier in dialect-specific delimiters.
Postgres/SQLite: double-quotes. MySQL: backticks.
Source§fn placeholder(&self, _n: usize) -> String
fn placeholder(&self, _n: usize) -> String
Positional placeholder for the n-th parameter (1-based).
Postgres:
$1. MySQL/SQLite: ?.Source§fn cast_expr(&self, placeholder: &str, _cast: &str) -> String
fn cast_expr(&self, placeholder: &str, _cast: &str) -> String
Wrap a placeholder with a type cast where required.
Postgres:
$1::uuid. MySQL/SQLite: placeholder returned unchanged.Source§fn uuid_default_expr(&self) -> &'static str
fn uuid_default_expr(&self) -> &'static str
Expression that generates a random UUID as a column DEFAULT.
Source§fn returning_clause(&self, cols: &str) -> String
fn returning_clause(&self, cols: &str) -> String
RETURNING clause appended to INSERT/UPDATE/DELETE, or empty string when unsupported.
Source§fn upsert_conflict(&self, conflict_cols: &[&str], set_pairs: &str) -> String
fn upsert_conflict(&self, conflict_cols: &[&str], set_pairs: &str) -> String
Upsert conflict suffix.
conflict_cols: columns that identify the conflict.
set_pairs: pre-built “col = value” pairs for the update branch.Source§fn to_one_subquery(&self, col_exprs: &[String], from_clause: &str) -> String
fn to_one_subquery(&self, col_exprs: &[String], from_clause: &str) -> String
Build a scalar subquery returning a single JSON object for a to-one include.
col_exprs: already-quoted column expressions.
from_clause: "schema"."table" WHERE ... fragment.Source§fn to_many_subquery(&self, col_exprs: &[String], from_clause: &str) -> String
fn to_many_subquery(&self, col_exprs: &[String], from_clause: &str) -> String
Build a scalar subquery returning a JSON array for a to-many include.
Source§fn json_extract_text(&self, col: &str, key: &str) -> String
fn json_extract_text(&self, col: &str, key: &str) -> String
Extract a top-level key from a JSON/JSONB column as text.
col is an already-quoted column expression; key is the raw JSON key (escaped here).
Postgres: (col ->> 'key'). MySQL/SQLite: col->>'$.key'.Source§fn json_extract_typed(&self, col: &str, key: &str, t: &CanonicalType) -> String
fn json_extract_typed(&self, col: &str, key: &str, t: &CanonicalType) -> String
Extract a JSON key and cast it to
t so comparisons and ORDER BY are type-correct.
For text-like types this is equivalent to Dialect::json_extract_text.Source§fn case_insensitive_like(&self, col: &str, placeholder: &str) -> String
fn case_insensitive_like(&self, col: &str, placeholder: &str) -> String
Case-insensitive LIKE comparison fragment:
col <ci-like> placeholder.
Postgres: col ILIKE ph. MySQL: LOWER(col) LIKE LOWER(ph). SQLite: col LIKE ph
(SQLite LIKE is case-insensitive for ASCII by default).Source§fn sys_json_type(&self) -> &'static str
fn sys_json_type(&self) -> &'static str
DDL fragment for a JSON/JSONB payload column (e.g. “JSONB”, “JSON”, “TEXT”).
Source§fn sys_timestamp_type(&self) -> &'static str
fn sys_timestamp_type(&self) -> &'static str
Timestamp type name (without NOT NULL / DEFAULT).
Source§fn sys_bigserial_type(&self) -> &'static str
fn sys_bigserial_type(&self) -> &'static str
Auto-incrementing large integer for surrogate PKs.
e.g. “BIGSERIAL”, “BIGINT AUTO_INCREMENT”, “INTEGER”.
Source§fn sys_bytes_type(&self) -> &'static str
fn sys_bytes_type(&self) -> &'static str
DDL type for a raw binary payload column (e.g. “BYTEA”, “BLOB”).
Source§fn audit_timestamp_type(&self) -> &'static str
fn audit_timestamp_type(&self) -> &'static str
Timestamp type used in audit table columns (no DEFAULT — values supplied explicitly).
Source§fn supports_schemas(&self) -> bool
fn supports_schemas(&self) -> bool
Whether this dialect supports
CREATE SCHEMA DDL.
Postgres: true. MySQL: false (uses databases). SQLite: false (no user-defined schemas).Source§fn default_now_plus_hours(&self, _hours: u32) -> Option<String>
fn default_now_plus_hours(&self, _hours: u32) -> Option<String>
DDL fragment for a column that holds a timestamp defaulting to N hours from now.
Returns
None when the dialect has no constant-expression equivalent (SQLite).
Callers should make the column nullable and omit the DEFAULT when None is returned.Source§fn supports_rls(&self) -> bool
fn supports_rls(&self) -> bool
Whether this dialect natively supports row-level security (CREATE POLICY etc.).
Source§fn supports_named_enum_types(&self) -> bool
fn supports_named_enum_types(&self) -> bool
Whether this dialect supports named enum types (CREATE TYPE … AS ENUM).
Source§fn supports_index_include(&self) -> bool
fn supports_index_include(&self) -> bool
Whether this dialect supports INCLUDE columns on indexes (Postgres 11+).
Source§fn set_tenant_session_sql(&self, _tenant_id: &str) -> Option<String>
fn set_tenant_session_sql(&self, _tenant_id: &str) -> Option<String>
SQL statement that sets a session-local tenant identifier before a query.
Returns
None when the dialect has no such mechanism.Source§fn sys_timestamp_default(&self) -> String
fn sys_timestamp_default(&self) -> String
NOT NULL timestamp column with a now() default — convenience built from above.
Auto Trait Implementations§
impl Freeze for SqliteDialect
impl RefUnwindSafe for SqliteDialect
impl Send for SqliteDialect
impl Sync for SqliteDialect
impl Unpin for SqliteDialect
impl UnsafeUnpin for SqliteDialect
impl UnwindSafe for SqliteDialect
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more