Graphorin API reference v0.12.1
Graphorin API reference / @graphorin/store-sqlite-encrypted / / EncryptDatabaseOptions
Interface: EncryptDatabaseOptions
Defined in: packages/store-sqlite-encrypted/src/encrypt.ts:40
Options for encryptDatabase.
Stable
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
cipher? | readonly | EncryptionCipher | Cipher selection. Default 'sqlcipher' (SQLCipher v4 compatible). | packages/store-sqlite-encrypted/src/encrypt.ts:48 |
overwriteTarget? | readonly | boolean | If true, overwrite an existing targetPath instead of failing. Default false. | packages/store-sqlite-encrypted/src/encrypt.ts:68 |
passphrase | readonly | string | Buffer<ArrayBufferLike> | Passphrase for the new encrypted DB. | packages/store-sqlite-encrypted/src/encrypt.ts:46 |
sourcePath | readonly | string | Path to the existing unencrypted source DB. | packages/store-sqlite-encrypted/src/encrypt.ts:42 |
swap? | readonly | boolean | If true, atomically rename targetPath -> sourcePath after the integrity check passes. The original sourcePath is renamed to ${sourcePath}.bak.${timestamp} so an operator can recover. Default false - the CLI does the swap explicitly. REQUIRES A STOPPED SERVER (W-012): a live writer keeps its file descriptor on the renamed .bak inode and every post-snapshot commit silently diverges from the new encrypted file (and is later deleted by storage cleanup-backups). A best-effort live-writer probe refuses the swap with EncryptSwapLiveWriterError when another connection holds the database; the probe-to-rename window remains a documented residual race. | packages/store-sqlite-encrypted/src/encrypt.ts:63 |
targetPath | readonly | string | Path the encrypted output is written to. Must not exist. | packages/store-sqlite-encrypted/src/encrypt.ts:44 |