mdk-sqlite-storage
SQLite-based persistent storage backend for MDK. Implements the MdkStorageProvider trait from mdk-storage-traits.
Designed for production use. The database is encrypted at rest using SQLCipher (ChaCha20-Poly1305) with a 256-bit key.
Features
- Encrypted SQLite database via SQLCipher
- Automatic schema migrations
- Optional keyring integration via
keyring-corefor secure key management - File permission hardening (mode
0600on Unix)
Usage
Automatic key management (recommended)
Initialize your platform's keyring store once at app startup, then let MDK handle key generation and storage:
use MdkSqliteStorage;
// e.g., keyring_core::set_default_store(AppleStore::new());
let storage = new?;
Manual key management
use ;
let key = ; // your securely stored 32-byte key
let config = new;
let storage = new_with_key?;
Unencrypted (development only)
use MdkSqliteStorage;
// ⚠️ WARNING: unencrypted — for development/testing only
let storage = new_unencrypted?;
Changelog
All notable changes to this library are documented in the CHANGELOG.md.
State
This library is in an ALPHA state. Things that are implemented generally work, but the API may change in breaking ways.
License
This project is distributed under the MIT software license - see the LICENSE file for details, or visit https://opensource.org/licenses/MIT.