Expand description
Database access layer.
Provides connection pool initialization, migration execution, and query helpers for the three supported backends: SQLite, PostgreSQL, and MariaDB.
The shared connection pool type Db is a runtime-dispatch AnyPool
that routes queries to the configured backend. All write transactions
on SQLite should go through begin_write rather than pool.begin()
to avoid SQLITE_BUSY_SNAPSHOT in WAL mode.
Modules§
- schema
- Embedded database migrations and schema version tracking.
Enums§
- DbKind
- Which database backend is active.
Functions§
- begin_
write - Begin a write transaction.
- init_
pool - Initialize the primary (read-write) database connection pool.
- init_
ro_ pool - Initialize a read-only connection pool for GET handlers.
- run_
migrations - Run pending database migrations.
Type Aliases§
- Db
- Type alias for the shared connection pool (runtime-dispatch Any backend).