feat: add SQLCipher integration (encrypted SQLite variant) - #121
Merged
Conversation
…adapter SQLCipher is an encrypted SQLite variant. It reuses the existing SQLite adapter (CoreDatabaseType::SQLite) with an encryption key applied via PRAGMA key on connection. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…ections SQLitePool and SQLiteAdapter now accept an optional encryption_key. When set (SQLCipher), the key is applied via PRAGMA key after opening the connection. Without the sqlcipher cargo feature, the PRAGMA is silently ignored, preserving backward compatibility with regular SQLite. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…dules Adds SQLCipher parsing in state.rs (parse_db_type, to_connection_config), helpers.rs (db_type_to_enum, is_file_based_db), and maps SQLCipher to SQLite DDL generation and type conversion in the transfer module. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Adds an optional sqlcipher cargo feature that compiles rusqlite with bundled-sqlcipher instead of bundled SQLite. SQLCipher is backwards-compatible with regular SQLite databases. Build with: cargo build --no-default-features --features sqlcipher Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Adds SQLCIPHER enum to DatabaseType, backend mappings (dbTypeToBackend/dbTypeFromBackend), SVG logo (green-tinted SQLite icon with lock motif), and i18n labels for enUS and zhCN. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…ey field SQLCipher shows a file picker for the database path (like SQLite) plus a password field for the encryption key. Port defaults to 0. Uses the existing file-based form patterns. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements SQLCipher integration as described in #95 — an encrypted SQLite variant that reuses the existing SQLite adapter with an encryption key applied via
PRAGMA keyon connection.Changes
Backend (Rust)
SQLCiphervariant toDatabaseTypeenum, route →CoreDatabaseType::SQLiteencryption_keysupport toSQLitePool/SQLiteAdapter— appliesPRAGMA keystate.rs,helpers.rs, transfer DDL and type mappingsqlciphercargo feature (rusqlite/bundled-sqlcipher)Frontend (TypeScript/Vue)
SQLCIPHERenum, SVG logo, icon mapping, i18n labels (enUS/zhCN)How to Build with SQLCipher
Default build (without the feature) uses regular SQLite — fully backward compatible.
Architecture
SQLCipher reuses the same
SQLiteAdapter(rusqlite) with thebundled-sqlcipherfeature. The encryption key is passed via the connection password field:SQLiteAdapter::new()extracts the encryption key fromconfig.passwordwhendb_type == SQLCipherPRAGMA key = 'passphrase'is executed after openingCloses #95 (SQLCipher portion)