Registry / database / pouchdb-adapter-websql-core

pouchdb-adapter-websql-core

JSON →
library7.0.0jsnpmunverified

Internal adapter code providing the WebSQL and SQLite-based storage backend for PouchDB. Version 7.0.0 is pegged to PouchDB's release; this package does not follow semver. It is intended for use by PouchDB or its plugins, not directly by end users. The adapter leverages the WebSQL API (deprecated in browsers) and SQLite on mobile via Cordova/PhoneGap, enabling offline-first databases in environments where IndexedDB is unavailable. It is part of the PouchDB monorepo and is rarely installed directly.

npm install pouchdb-adapter-websql-core
INSTALL
IMPORT
SIG · POUCHDB-ADAPTER-WE
P
pouchdb-adapter-websql-core
databasejavascriptv7.0.0
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.

default export
✓ import PouchDB from 'pouchdb'; import WebSQLAdapter from 'pouchdb-adapter-websql-core'; PouchDB.plugin(WebSQLAdapter);
✗ const WebSQLAdapter = require('pouchdb-adapter-websql-core');
The adapter must be plugged into PouchDB; direct import alone does nothing.

Shows how to import WebSQL core adapter and create a PouchDB instance using the WebSQL adapter.

import PouchDB from 'pouchdb'; import WebSQLAdapter from 'pouchdb-adapter-websql-core'; // Register the adapter PouchDB.plugin(WebSQLAdapter); // Create a database using the WebSQL adapter const db = new PouchDB('mydb', { adapter: 'websql' }); db.put({ _id: 'doc1', name: 'Test' }).then(() => { return db.get('doc1'); }).then(doc => { console.log(doc); }).catch(err => { console.error(err); });
Debug
Known issues
gotchaThis package does not follow semver; its version is pegged to PouchDB. Use exact versions (--save-exact) to avoid unintended breaking changes.
fix
Install with npm install --save-exact pouchdb-adapter-websql-core
affects: >=7.0.0
deprecatedWebSQL is deprecated in non-Chromium browsers (per W3C). Use IndexedDB (pouchdb-adapter-idb) for cross-browser support.
fix
Switch to pouchdb-adapter-idb or pouchdb-adapter-idb-next
affects: >=7.0.0
gotchaThe adapter must be registered via PouchDB.plugin(); simply importing it does not activate the adapter.
fix
Call PouchDB.plugin(WebSQLAdapter) before creating a database with adapter: 'websql'
affects: >=7.0.0
breakingVersion 7.0.0 dropped support for callbacks; promises are required.
fix
Use .then()/catch() or async/await instead of callbacks
affects: >=7.0.0
Errors
Common errors & fixes
Error: adapter is not defined / websql is not available
WebSQL adapter not registered; or environment does not support WebSQL (e.g., Node.js, non-Chromium browsers).
fix
Register adapter: PouchDB.plugin(WebSQLAdapter). Use in Chromium-based browser or Cordova.
TypeError: PouchDB.plugin is not a function
PouchDB and the adapter are loaded incorrectly (likely mixed CJS/ESM or missing PouchDB import).
fix
Ensure both PouchDB and the adapter use the same module system (ESM or CJS). Import PouchDB first.
Cannot find module 'pouchdb-adapter-websql-core'
Package not installed or version mismatch.
fix
Run: npm install --save-exact pouchdb-adapter-websql-core
Upgrade
Version history
7.0.0latest on npm
Audit
Dependencies
pouchdbrequiredCore PouchDB library; adapter is a plugin for PouchDB
Agent activity
8 hits · last 30 days
node
6
Resources
pouchdb-adapter-websql-core — npm install pouchdb-adapter-websql-core · libregistry