Skip to main content

Module db

Module db 

Source
Expand description

The identity database: SQLite in WAL mode, schema migrations recorded in schema_version.

Times are unix seconds. Token columns hold SHA-256 hashes, never tokens. Roles are text, validated in Rust (super::Role), so a new role needs no migration.

Constants§

SCHEMA_VERSION
The schema version this build writes.

Functions§

migrate
Apply every migration past the recorded version, each in its own transaction. A database from a newer isb is refused, not downgraded.
open
Open (creating if needed) and migrate. The file is 0600 in a 0700 directory: it holds password hashes.
open_in_memory
An in-memory database, for tests.
version
The version recorded in schema_version, 0 for a new database.