Skip to main content

SqliteDialect

Struct SqliteDialect 

Source
pub struct SqliteDialect;

Trait Implementations§

Source§

impl Dialect for SqliteDialect

Source§

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

DDL type string for CREATE TABLE (e.g. “TIMESTAMPTZ”, “DATETIME”, “TEXT”).
Source§

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

Broad category for RSQL operator validation.
Source§

fn type_support(&self, t: &CanonicalType) -> TypeSupport

How well this dialect supports the canonical type.
Source§

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

Positional placeholder for the n-th parameter (1-based). Postgres: $1. MySQL/SQLite: ?.
Source§

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 now_fn(&self) -> &'static str

Current-timestamp function name/expression.
Source§

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

RETURNING clause appended to INSERT/UPDATE/DELETE, or empty string when unsupported.
Source§

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

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

Build a scalar subquery returning a JSON array for a to-many include.
Source§

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

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

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

DDL fragment for a JSON/JSONB payload column (e.g. “JSONB”, “JSON”, “TEXT”).
Source§

fn sys_timestamp_type(&self) -> &'static str

Timestamp type name (without NOT NULL / DEFAULT).
Source§

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

DDL type for a raw binary payload column (e.g. “BYTEA”, “BLOB”).
Source§

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

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>

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

Whether this dialect natively supports row-level security (CREATE POLICY etc.).
Source§

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

Whether this dialect supports INCLUDE columns on indexes (Postgres 11+).
Source§

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

NOT NULL timestamp column with a now() default — convenience built from above.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more