Skip to main content

SqliteSqlGenerator

Struct SqliteSqlGenerator 

Source
pub struct SqliteSqlGenerator;

Implementations§

Trait Implementations§

Source§

impl Clone for SqliteSqlGenerator

Source§

fn clone(&self) -> SqliteSqlGenerator

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SqliteSqlGenerator

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SqliteSqlGenerator

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl ISqlGenerator for SqliteSqlGenerator

Source§

fn select(&self, table: &str, columns: &[&str]) -> String

Generates a SELECT statement.
Source§

fn insert(&self, table: &str, columns: &[&str], _returning: bool) -> String

Generates an INSERT statement.
Source§

fn insert_batch( &self, table: &str, columns: &[&str], row_count: usize, ) -> String

Generates a multi-row INSERT statement with row_count value groups (INSERT INTO t (c1, c2) VALUES (?, ?), (?, ?), ...). Placeholders follow the dialect’s numbering (? for SQLite/MySQL, $n for PG).
Source§

fn upsert_batch( &self, table: &str, columns: &[&str], conflict_cols: &[&str], row_count: usize, ) -> String

Generates a batch UPSERT statement (row_count value groups). Read more
Source§

fn update( &self, table: &str, set_columns: &[&str], where_clause: &str, ) -> String

Generates an UPDATE statement.
Source§

fn delete(&self, table: &str, where_clause: &str) -> String

Generates a DELETE statement.
Source§

fn create_table(&self, table: &str, columns: &[(String, String)]) -> String

Generates a CREATE TABLE statement.
Source§

fn drop_table(&self, table: &str) -> String

Generates a DROP TABLE statement.
Source§

fn pagination(&self, skip: Option<usize>, take: Option<usize>) -> String

Generates a pagination clause.
Source§

fn parameter_placeholder(&self, _index: usize) -> String

Returns the parameter placeholder (e.g., $1 for PG, ? for MySQL).
Source§

fn quote_identifier(&self, identifier: &str) -> String

Returns the identifier quoting character (e.g., " for PG, ` for MySQL).
Source§

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

Returns the dialect-specific auto-increment syntax.
Source§

fn supports_returning(&self) -> bool

Whether insert_batch includes a RETURNING * clause (PostgreSQL). When true, execute_inserts uses query() to read back generated PKs directly from the INSERT result set.
Source§

fn last_insert_id_sql(&self) -> Option<&'static str>

SQL that retrieves the auto-increment key generated by the most recent batch INSERT. Returns None when the dialect uses RETURNING instead. Read more
Source§

fn last_insert_id_returns_first(&self) -> bool

Whether last_insert_id_sql() returns the FIRST (MySQL) or LAST (SQLite) generated ID in a batch INSERT. The executor uses this to compute the full key sequence: first_id..first_id+N or last_id-N+1..last_id.
Source§

fn update_batch( &self, table: &str, set_columns: &[&str], pk_col: &str, row_count: usize, where_clause: &str, ) -> String

Generates a batch UPDATE using CASE pk_col WHEN ? THEN ? for row_count rows, reducing N round trips to 1. Read more
Source§

fn uses_numbered_placeholders(&self) -> bool

Whether the dialect uses numbered placeholders (e.g. PostgreSQL $1, $2) where the index depends on position within the full statement. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.