oxide-sql-sqlite
SQLite-specific extensions for oxide-sql-core.
How SQLite differs from other dialects
- UPSERT: SQLite supports
INSERT ... ON CONFLICT DO NOTHINGandON CONFLICT DO UPDATE SET ...(since SQLite 3.24.0). This crate provides [UpsertBuilder] for type-safe upsert construction. - RETURNING: SQLite supports
RETURNINGclauses on INSERT, UPDATE, and DELETE (since SQLite 3.35.0). - Identifier quoting: SQLite uses double quotes (
") as the standard quoting style, though it also accepts backticks and square brackets. See SQLite keywords. - Type affinity: SQLite uses a type-affinity system rather
than strict column types. Any column can store any value
regardless of declared type (unless
STRICTtables are used). - Limited ALTER TABLE: SQLite only supports
RENAME TABLE,RENAME COLUMN, andADD COLUMN. It does not supportDROP COLUMN(before 3.35.0),ALTER COLUMN, orADD CONSTRAINT. - AUTOINCREMENT: SQLite uses the
AUTOINCREMENTkeyword (not sequences orSERIALlike PostgreSQL/DuckDB).
Example
use UpsertBuilder;
use ToSqlValue;
// UPSERT example
let = new
.into_table
.columns
.values
.on_conflict
.do_update
.build;