Skip to content

feat: add SQLCipher integration (encrypted SQLite variant) - #121

Merged
Blankll merged 6 commits into
masterfrom
feat/sqlcipher-integration
Jul 27, 2026
Merged

feat: add SQLCipher integration (encrypted SQLite variant)#121
Blankll merged 6 commits into
masterfrom
feat/sqlcipher-integration

Conversation

@Blankll

@Blankll Blankll commented Jul 27, 2026

Copy link
Copy Markdown
Member

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 key on connection.

Changes

Backend (Rust)

Commit Description
87983d3 Add SQLCipher variant to DatabaseType enum, route → CoreDatabaseType::SQLite
3ff8470 Add encryption_key support to SQLitePool / SQLiteAdapter — applies PRAGMA key
a26df40 Wire SQLCipher through state.rs, helpers.rs, transfer DDL and type mapping
7ccebf3 Add optional sqlcipher cargo feature (rusqlite/bundled-sqlcipher)

Frontend (TypeScript/Vue)

Commit Description
33ca53a Add SQLCIPHER enum, SVG logo, icon mapping, i18n labels (enUS/zhCN)
fca99d0 Connection form: file picker + password field for encryption key

How to Build with SQLCipher

cargo build -p sqlkit --no-default-features --features sqlcipher

Default build (without the feature) uses regular SQLite — fully backward compatible.

Architecture

SQLCipher reuses the same SQLiteAdapter (rusqlite) with the bundled-sqlcipher feature. The encryption key is passed via the connection password field:

  1. User selects SQLCipher database type
  2. Picks the encrypted file + enters passphrase
  3. SQLiteAdapter::new() extracts the encryption key from config.password when db_type == SQLCipher
  4. On connection, PRAGMA key = 'passphrase' is executed after opening
  5. Query execution is identical to SQLite (same adapter, same SQL dialect)

Closes #95 (SQLCipher portion)

Blankll and others added 6 commits July 27, 2026 19:49
…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>
@Blankll
Blankll merged commit ce1e8a6 into master Jul 27, 2026
3 checks passed
@Blankll
Blankll deleted the feat/sqlcipher-integration branch July 27, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support additional database types: Cloudflare D1, chDB, SQLCipher, R2 SQL, Workers Analytics Engine

1 participant