Safe Rasmalai wrapper over the SQLite amalgamation (3.54.1).
The wrapper talks to libsqlite3 through opaque Pointer<Byte> handles only.
No struct passes by value anywhere in the surface. Every foreign call sits
inside a small unsafe block; the public functions are safe.
Layout
Project.config— package manifest (sqlite-rnx0.1.0, MIT).src/index.rnx— hand-written safe wrapper (open,exec,queryInt,queryText,errmsg,close, plustoCString/fromCStringhelpers and theSQLITE_OK/SQLITE_ROW/SQLITE_DONEcodes).build/— downloaded SQLite amalgamation (header plus sources) used by thebindgendriver. Scratch-only, never published.src/gen/— produced byrnx task bindgen, not checked in by hand.
API
import { open, exec, queryInt, close } from "sqlite-rnx";
let db = open(":memory:").unwrap();
exec(db, "CREATE TABLE t(x)");
exec(db, "INSERT INTO t VALUES (42)");
print(queryInt(db, "SELECT x FROM t").unwrap());
close(db);open gives Result<Pointer<Byte>, String>; a failed open is an Err with
the SQLite return code path. exec and close return the raw SQLite return
code (SQLITE_OK is 0); errmsg reads the pending message for a handle.
queryInt and queryText prepare, step once, and finalize, returning the
first column of the first row or an Err naming the failure. Strings cross
the boundary as ASCII: toCString writes one byte per character.
Native source
The sqlite3 dependency names the libsqlite3.a blob by its from title in
the package's own artifacts image and links statically. The root native
table re-pins the same title at version 3.54.1 with system: false. The
bindgen driver reads build/sqlite3.h and writes src/gen/sqlite3.rnx.