@devioarts/capacitor-sqlite
@devioarts/capacitor-sqlite is a SQLite plugin for Capacitor that
gives iOS, Android, Web, and Electron apps one JavaScript API for schema migrations,
parameterized queries, batch writes, and manual transactions over a real SQLite database.
It is for Capacitor app developers who need local relational storage — offline data, caches, sync queues, or structured app state — without embedding a different SQLite wrapper per platform.
Platforms
| Platform | Engine | Minimum version |
|---|---|---|
| iOS | SQLite3 (system library) | iOS 15 |
| Android | SQLiteDatabase (Android framework) |
API 24 |
| Web | @sqlite.org/sqlite-wasm over OPFS |
SharedArrayBuffer/COOP+COEP; Safari 17+ |
| Electron | Node's built-in node:sqlite, off the main process |
Electron 40+ (Node 24+) |
What it does
- Schema migrations driven by
PRAGMA user_version— each version runs in its own transaction. - Parameterized
run(),query(), and DDL/bulkexecute(). runBatch()for mixed-SQL bulk writes andrunMany()for one repeated statement over many value sets, both in a single native call.- Manual transaction control:
beginTransaction()/commitTransaction()/rollbackTransaction(). - In-memory databases via
':memory:'. - Every method resolves to a typed
SqliteResult— it never rejects, so failures are always inspectable as data.
What it does not do
- No encryption (no SQLCipher or similar at-rest encryption).
- No JSON import/export helpers or sync tables.
- No SQL sandboxing —
statementtext is trusted application code, not a boundary for user-authored SQL. See SQL trust boundary.
Where to go next
- New to the plugin: Quick start.
- Setting up a specific platform: Installation.
- Understanding the API's mental model before writing code: Concepts.
- Day-to-day task guides: Usage, Migrations, Transactions, Bulk writes.
- Full method/type signatures: API reference.
- Platform-specific storage paths and behavioral caveats: Platform notes.
Project links
- Repository: github.com/devioarts/capacitor-sqlite
- Issues: github.com/devioarts/capacitor-sqlite/issues
- License: MIT