Expand description
An SQLite catalog, encrypted with SQLCipher under its catalog key.
Enums§
- Catalog
Error - Why a catalog did not open.
Constants§
- BUSY_
TIMEOUT - How long a statement waits for another connection’s lock before it fails busy. It is rusqlite’s own default, stated so it is chosen, not inherited; a caller that must not wait inside SQLite sets zero for the call and restores this.
- SCHEMA_
VERSION - The schema version this build makes and reads. Version 2 added the time each uuid was first stored to a tenant catalog’s vcon table; version 3 added each tenant’s metadata level to server.sqlite; version 4 added the places of packed versions and the pack tables to a tenant catalog.
Functions§
- backup
- Copies the catalog
sourceis open on to a new file atto, kept underkey, which must be the keysourcewas opened with. It uses SQLite’s online backup API and copies every page in one step, so the copy is the catalog as one commit left it, the WAL’s committed frames included, while other connections go on writing.tomust not exist: it is made empty first, so a file already there is never written over. The copy and its directory are synced. - copy_
under - Writes every row, the schema and its version of the catalog at
path, kept underold, to a new file beside it kept undernew, and returns that file’s path. The old file is only read. A file left there by an interrupted run is replaced. - open
- Opens the catalog at
pathunderkey, making it withschemaif it is new. - reencrypt
- Re-encrypts the catalog at
path, kept underold, so that it is kept undernew: every row, the schema and its version are written to a new file undernew, which then replaces the old one by rename. A crash leaves either the whole old file or the whole new one, and nothing of the old file’s pages is carried into the new one. A file left by an interrupted run is replaced. - replace
- Makes
copythe catalog atpath: it is synced, renamed overpath, and the directory synced. Every connection to either file must be closed. Their WAL files must be empty, as a last close leaves them; one still holding frames would sit beside the wrong file, so it is refused.