CodeName OneShai Almog11 min readintermediate
SQLite Across Every Port: One Contract, One Encrypted File Format
Summary
Codename One now ships a single, tested SQLite contract that works natively on Android, iOS, Windows, Linux, and in browsers via WebAssembly, with built‑in SQLCipher‑4 encryption supporting three key models. A conformance suite guarantees identical behavior across platforms, and migration helpers let legacy apps opt‑in. The update also adds a proper watch‑app model, DOM‑based text for JavaScript,…
- A unified SQLite implementation replaces the previous platform‑specific back‑ends, eliminating divergent cursor, transaction, and blob semantics.
- The new `DatabaseConformanceSuite` runs seven device tests on every target (Android, iOS, macOS, tvOS, watchOS, Windows, Linux, JavaScript) to verify lifecycle, statements, cursors, transactions, encryption, and legacy…
- Encryption is now first‑class via `DatabaseConfig` with three key models: user‑supplied passphrase, managed keystore/keychain key, or raw 32‑byte key, all using the SQLCipher‑4 on‑disk format (AES‑256‑CBC, PBKDF2‑HMAC‑S…
- Plaintext databases can be upgraded in‑place with `Database.encrypt(...)` without API changes.
Cross‑platform consistency is critical for mobile‑first frameworks; divergent SQLite behavior caused subtle bugs that only appeared on specific devices. A single contract plus automated conformance testing gives developers confidence that a query behaves the same on a phone, desktop, or web client,…
6/10