Skip to main content

Crate rightkit_db

Crate rightkit_db 

Source

Structs§

CheckpointStatus
DbOptions
MigrateOptions
Migration
MigrationReport
OpenOutcome
PendingMarker
PooledReadConnection
ReadPool
RecoveryPolicy

Enums§

CacheProfile
DbError
DurabilityProfile
JournalSelect
How the journal mode is chosen. WAL needs working shared-memory locking, which network filesystems often lack and which SQLite will silently downgrade; the default therefore verifies the mode that took effect and falls back to a rollback journal.
Step

Constants§

JOURNAL_ENV
Environment kill-switch (wal | delete | truncate) for a misclassified mount in the field. An app’s own variable (DbOptions::journal_env) is checked first.

Traits§

BackupProgress

Functions§

add_column_if_missing
Idempotent ALTER TABLE .. ADD COLUMN (SQLite has no IF NOT EXISTS for columns). table, column and decl must be literals from the app, never user input.
checkpoint_if_wal_larger_than
checkpoint_truncate
column_exists
True if table has column, including STORED/VIRTUAL generated columns (table_xinfo; table_info omits them, which made MailRight re-run an ALTER on every open).
journal_mode
The journal mode SQLite is actually running (wal, delete, …).
migrate
online_backup_to
Back source up to target. options supplies the SQLCipher key (if any) so the backup is encrypted with the same key; its path is ignored.
optimize_boundary
optimize_on_open
pending_marker
per_host_path
name.db -> name.h-<host>.db (extension-less names get the tag appended). Idempotent; unchanged when no host name is available.
quarantine_database
Move db and its -wal / -shm / -journal sidecars to <db>.corrupt-<unix-ms>[...]. Returns the new main-file path. Nothing is deleted.
rollback_to
Revert to target by replaying each step’s down, highest first, one transaction per step. Refuses before touching anything unless every step in the range has a down.
user_version
write_txn
Start a transaction that reserves SQLite’s single writer slot up front. This keeps read-then-write work out of the unretryable BUSY_SNAPSHOT path.

Type Aliases§

ConnInit
Post-key, pre-pragma per-connection initializer (register functions, collations, …).
Result