cratefield-adapter-sqlite
The [Database] port over rusqlite (bundled SQLite) for the Factory
Zero harness. Native only — never compiled to wasm. Used by every module
test and by cratefield-testing, and viable for a single-node self-hosted
deployment (ADR 0004).
use SqliteDatabase;
let db = in_memory?; // or ::open("venture.db")
db.apply_migrations?; // tracked in harness_migrations
// ... through Arc<dyn Database> as usual
batchruns all statements in one transaction (atomic).apply_migrations(module, &[SqlMigration])is idempotent: each migration is tracked under<module>/<id>in aharness_migrationstable and applied in its own transaction.- The
rusqliteconnection is!Sync, so it lives behind a mutex; this is connection guarding, not request state (see the workspaceclippy.tomlpolicy).
MIT. Built in the open for Cratefield, a Factory Zero venture.