Skip to content

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

PropertyModifierTypeDescriptionDefined in
cipher?readonlyEncryptionCipherCipher selection. Default 'sqlcipher' (SQLCipher v4 compatible).packages/store-sqlite-encrypted/src/encrypt.ts:48
overwriteTarget?readonlybooleanIf true, overwrite an existing targetPath instead of failing. Default false.packages/store-sqlite-encrypted/src/encrypt.ts:68
passphrasereadonlystring | Buffer<ArrayBufferLike>Passphrase for the new encrypted DB.packages/store-sqlite-encrypted/src/encrypt.ts:46
sourcePathreadonlystringPath to the existing unencrypted source DB.packages/store-sqlite-encrypted/src/encrypt.ts:42
swap?readonlybooleanIf 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
targetPathreadonlystringPath the encrypted output is written to. Must not exist.packages/store-sqlite-encrypted/src/encrypt.ts:44