Skip to main content

Module profile

Module profile 

Source
Expand description

DDL-free connection opening under named policy profiles.

Every profile maps to a policy that already existed somewhere in the workspace; the profiles name those policies instead of erasing them:

  • ConnectionProfile::Primary: the production writer policy (WAL + synchronous=FULL + the one shared busy timeout). With create: false it is the no-create writer variant previously hand-rolled for identity databases. WAL establishment is verified against the mode SQLite reports back, and the journal-mode conversion only runs after the OpenOptions::schema_preflight ledger check, so an old binary refuses a future file before mutating it.
  • ConnectionProfile::ReadOnly: passive observation (SQLITE_OPEN_READ_ONLY | URI | NO_MUTEX, shared busy timeout, no pragma mutation — a reader must not convert a foreign file’s journal mode). The precise no-write guarantee is typed as WriteContact::ReadOnlyWalSidecars: logical content is never altered, but WAL sidecars may be required to read a WAL database.
  • ConnectionProfile::Maintenance: fail-fast offline access (zero busy timeout, never creates, no pragma mutation). This is the profile for migration/diagnostic work performed by the party holding the exclusive maintenance fence; it deliberately does not take a shared fence guard.

Opening a connection never runs schema DDL. Stores apply their crate::ledger domain after opening.

Structs§

OpenOptions
Per-open overrides. The zero-value default defers everything to the profile.

Enums§

ConnectionProfile
Named connection policy profiles.
WriteContact
The strongest filesystem no-write guarantee an open under a profile can make. Diagnostic surfaces (doctor) report from this instead of promising a zero-touch open that SQLite cannot deliver.

Constants§

SHARED_BUSY_TIMEOUT
The one shared busy timeout for production profiles.

Functions§

begin_immediate
Begin an IMMEDIATE transaction. Bounded waiting for the write lock is the connection busy handler’s job (set at open per profile), not a caller retry loop.
open
Open path under profile with the profile’s defaults.
open_with
Open path under profile with per-open overrides.