Moving from @capacitor-community/sqlite
Most apps using this plugin should keep it. It gives you SQL, joins, SQLCipher and an Electron target, and Strata's sqlite adapter gives you none of those: you can't write SQL against it. This guide is for the case where your database turned out to be one key-value table.
The calls
| @capacitor-community/sqlite | Strata Storage |
|---|---|
db.run('INSERT OR REPLACE ...', [key, value]) | storage.set(key, value, { storage: 'sqlite' }) |
db.query('SELECT value ... WHERE key = ?', [key]) | storage.get(key, { storage: 'sqlite' }) |
db.run('DELETE ... WHERE key = ?', [key]) | storage.remove(key, { storage: 'sqlite' }) |
db.query('SELECT key ...') | storage.keys(undefined, { storage: 'sqlite' }) |
db.query('SELECT ... WHERE field = ?') | storage.query({ field }, { storage: 'sqlite' }), a scan of every value |
Copy the table
This assumes a table named kv with key and value text columns holding JSON. Change the SQL to match yours.
import { CapacitorSQLite, SQLiteConnection } from '@capacitor-community/sqlite';
import { defineStorage } from 'strata-storage';
import { registerCapacitorAdapters } from 'strata-storage/capacitor';
export const storage = defineStorage();
export async function moveKeyValueTable(): Promise<void> {
await registerCapacitorAdapters(storage);
if (await storage.get<boolean>('moved:sqlite', { storage: 'sqlite' })) return;
const sqlite = new SQLiteConnection(CapacitorSQLite);
const db = await sqlite.createConnection('app', false, 'no-encryption', 1, false);
await db.open();
const { values = [] } = await db.query('SELECT key, value FROM kv');
for (const row of values as { key: string; value: string }[]) {
await storage.set(row.key, JSON.parse(row.value), { storage: 'sqlite' });
}
await sqlite.closeConnection('app', false);
await storage.set('moved:sqlite', true, { storage: 'sqlite' });
}
Strata writes to its own database, strata_storage unless you configure another, so the old file stays untouched until you delete it. If the old database is encrypted with SQLCipher, open it with the matching mode and passphrase, and decide how the values are protected on the other side first: Strata's encryption isn't SQLCipher. See the sqlite adapter for what it stores.
Read a moved key on each device before you remove the plugin.
@capacitor-community/sqlite as we checked it
Last checked 7 Nov 2026. "Not stated" means the pages we checked don't mention it, not that the library can't do it. Check @capacitor-community/sqlite yourself, or see the side-by-side page.
| Store or capability | @capacitor-community/sqlite | Strata Storage |
|---|---|---|
| localStorage | Not stated on the pages we checked | Yes |
| IndexedDB | Not stated on the pages we checked | Yes |
| sessionStorage | Not stated on the pages we checked | Yes |
| Cookies | Not stated on the pages we checked | Yes |
| URL parameters as a store | Not stated on the pages we checked | Yes |
| iOS Keychain | Not stated on the pages we checked. The README configures an iosKeychainPrefix for the database passphrase, not a key-value Keychain store | Yes |
| Android secure storage (Keystore-backed) | Not stated on the pages we checked | Yes |
| Native preferences (UserDefaults / SharedPreferences) | Not stated on the pages we checked | Yes |
| Web and native stores behind one API | Not stated on the pages we checked | Yes |
| No runtime dependencies | No. Depends on jeep-sqlite (source, 7 Nov 2026) | Yes |
| Package fact | @capacitor-community/sqlite | Strata Storage |
|---|---|---|
| Licence | MIT (source) | MIT (source) |
| npm version | 8.1.1 | 3.1.4 |
| Bundle size | 2,680 bytes gzipped, 13,852 minified, version 8.1.1, 7 Nov 2026. JavaScript side only; the native code is not counted by bundlephobia (source) | 21,468 bytes gzipped, 79,645 minified, version 3.1.4, 7 Nov 2026 (source) |
| Weekly downloads | 249,947, 31 Oct 2026 to 6 Nov 2026 (source) | 486, 31 Oct 2026 to 6 Nov 2026 (source) |