Expand description
Canonical SQLite connection builder shared by every microsandbox process.
Both the host CLI and the in-VM runtime open the same SQLite file and must apply identical PRAGMAs (WAL, busy timeout, foreign keys, synchronous=NORMAL). Centralising the builder keeps that contract in one place — when a new PRAGMA is needed, this is the only file to edit.
Structs§
- DbPools
- Read pool + dedicated single-connection write pool for the same SQLite
file. SQLite is single-writer system-wide, so a multi-connection pool
fighting for the writer lock just generates
SQLITE_BUSYand (under deferred transactions)SQLITE_BUSY_SNAPSHOT. Funnelling all writes from one process through a single connection turns within-process contention into an in-process queue (deterministic) instead of SQLite-level lock contention (probabilistic, retry-required). Reads keep the wider pool — WAL mode lets readers run concurrently.
Constants§
- DEFAULT_
BUSY_ TIMEOUT_ SECS - Default
busy_timeoutPRAGMA value used when a caller has no user-facing knob to plumb (e.g. the in-VM runtime, where the host owns DB-tuning policy and the runtime is not user-configurable).