SQLite driver for ::sql, backed by the ::hot::sqlite runtime natives — an embedded database, no server. Respects file.mode: host paths in direct mode; managed-storage checkout/commit in service mode (see ::hot::sqlite for the durability and concurrency model). Best for small, session-shaped workloads; high-frequency concurrent writers belong on ::sql::pg.

Functions

command-tag

fn (sql: Str): Str

SQLite reports no command tag, so derive one from the statement's first word ("INSERT", "UPDATE", ...). Exposed for testing.

open

fn (path-or-options: Str | Map): ::sql/Db

Open a SQLite-backed ::sql/Db. Pass a path string or an options map (path, read-only) — see ::hot::sqlite/open.

Example

db ::sql::sqlite/open("data/app.db")
::sql/execute(db, "CREATE TABLE IF NOT EXISTS t (id INTEGER PRIMARY KEY, name TEXT)", [])
::sql/execute(db, "INSERT INTO t (name) VALUES (?)", ["Ada"])
rows ::sql/query(db, "SELECT * FROM t WHERE name = :name", {name: "Ada"})
::sql/close(db)

sqlite-execute

fn (conn: Any, sql: Str, params: Vec): Map

sync

fn (db: ::sql/Db): Bool

Commit a service-mode checkout back to managed storage without closing (see ::hot::sqlite/sync). No-op in direct mode.