Skip to main content

Module backup

Module backup 

Source
Expand description

Backup capture and restore planning over the audit database.

Modules§

capture
Re-exports used by the executors.
extractor
Backup spec extraction (backup/extractor.ts port): what to capture before a mutation so it can be undone.
journal
Operation journal (D3): durable, crash-recoverable records linking backups, mutations, and audit across the local/remote database boundary. Because the audit DB and the target server cannot share a distributed transaction, every gated mutation writes journal transitions; a crash between remote commit and local finalization leaves a visibly ambiguous record rather than silent success/failure.
restore
Backup restore (legacy backup/restore.ts port): build a dialect-specific replay plan from a stored backup row, then execute it inside one transaction. Row backups replay as upserts, schema backups as their captured CREATE TABLE, and insert-hint backups as the DELETE of exactly the rows the original INSERT created. The restore always goes through the normal gate when invoked as a tool (it counts as a write).

Structs§

BackupDetail
BackupRow
Backup listing row (legacy shape).
CapturedBackup

Enums§

BackupError

Functions§

capture_backup_sqlite
Capture a pre-mutation backup from a SQLite handle, enforcing the row and byte caps with the policy’s overflow behaviour.
capture_insert_hint
Record an insert rollback hint (explicit PK values or autoincrement range) after a successful INSERT.
get_backup
insert_rows_backup_row
Insert a rows/combined backup row (used by the MySQL path).
insert_schema_backup_row
Insert a schema-only backup row (used by the MySQL and SQLite paths).
list_backups