Expand description
§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 providesUpsertBuilderfor 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 oxide_sql_sqlite::UpsertBuilder;
use oxide_sql_core::builder::value::ToSqlValue;
// UPSERT example
let (sql, params) = UpsertBuilder::new()
.into_table("users")
.columns(&["id", "name", "email"])
.values(vec![
1_i64.to_sql_value(),
"Alice".to_sql_value(),
"alice@example.com".to_sql_value(),
])
.on_conflict(&["id"])
.do_update(&["name", "email"])
.build();Re-exports§
pub use builder::UpsertBuilder;
Modules§
- builder
- SQLite-specific SQL builders.
Structs§
- Sqlite
Dialect - SQLite dialect.