Registry / database / capacitor-adapter-sqlite-pouchdb

capacitor-adapter-sqlite-pouchdb

JSON →
library1.0.2jsnpmunverified

PouchDB adapter using Capacitor SQLite Plugin as its backing store. Current stable version: 1.0.2. Release cadence is infrequent (no recent updates). Key differentiator: enables PouchDB to use native SQLite storage on Capacitor (iOS/Android) instead of IndexedDB/WebSQL, providing persistent offline data with SQLite reliability. Requires pairing with a Capacitor SQLite storage plugin (e.g., capacitor-sqlite-storage) and must be initialized after the Capacitor 'deviceready' event. Not suitable for browser-only use.

npm install capacitor-adapter-sqlite-pouchdb
INSTALL
IMPORT
SIG · CAPACITOR-ADAPTER-
C
capacitor-adapter-sqlite-pouchdb
databasejavascriptv1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

capacitorSqlitePlugin
import { capacitorSqlitePlugin } from 'pouchdb-adapter-capacitor-sqlite'
import { CapacitorSqliteAdapter } from 'pouchdb-adapter-capacitor-sqlite'
The only named export is 'capacitorSqlitePlugin'; check version for exact name.
PouchDB
import PouchDB from 'pouchdb-core'
const PouchDB = require('pouchdb-core')
PouchDB is imported separately; this adapter does not include PouchDB.
SQLite
import { SQLite } from 'capacitor-sqlite-storage'
import SQLite from 'capacitor-sqlite-storage'
Default import of SQLite is not supported; must use named import.

Initializes PouchDB with the Capacitor SQLite adapter, creates a database, and performs a put/get operation.

import PouchDB from 'pouchdb-core'; import { SQLite } from 'capacitor-sqlite-storage'; import { capacitorSqlitePlugin } from 'pouchdb-adapter-capacitor-sqlite'; PouchDB.plugin(capacitorSqlitePlugin(SQLite)); const db = new PouchDB('mydb.db', { adapter: 'capacitor-sqlite' }); db.put({ _id: 'test', value: 'hello' }).then(() => db.get('test').then(doc => console.log(doc)) );
Debug
Known issues
gotchaMust call within Capacitor 'deviceready' event or after platform ready; otherwise SQLite may not be available.
fix
Wrap adapter setup in Capacitor's 'deviceready' listener or use Capacitor's ready() function.
affects: all
breakingAdapter function 'capacitorSqlitePlugin' expects the entire SQLite object, not just the class.
fix
Pass the SQLite object (the result of import { SQLite } from 'capacitor-sqlite-storage') to the plugin function.
affects: all
deprecatedPouchDB v8+ changed the plugin registration API; check compatibility.
fix
Consult PouchDB plugin documentation; if issues occur, downgrade PouchDB to v7 or wrap plugin registration differently.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: PouchDB.plugin is not a function
PouchDB not imported correctly or not a PouchDB instance.
fix
Ensure you import PouchDB from 'pouchdb-core' (or pouchdb-browser) and call PouchDB.plugin correctly.
Error: adapter 'capacitor-sqlite' not found for 'mydb.db'
Adapter not registered or plugin not called correctly.
fix
Call PouchDB.plugin(capacitorSqlitePlugin(SQLite)) before creating the database.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
pouchdb-corerequiredPouchDB core needed to register the adapter plugin
capacitor-sqlite-storagerequiredProvides the SQLite object required by the adapter
Agent activity
11 hits · last 30 days
node
8
OpenAI (training)
1
Resources
capacitor-adapter-sqlite-pouchdb — npm install capacitor-adapter-sqlite-pouchdb · libregistry