{"id":45812,"library":"pouchdb-adapter-websql-core","title":"PouchDB WebSQL Core Adapter","description":"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.","status":"active","version":"7.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/pouchdb/pouchdb","tags":["javascript"],"install":[{"cmd":"npm install pouchdb-adapter-websql-core","lang":"bash","label":"npm"},{"cmd":"yarn add pouchdb-adapter-websql-core","lang":"bash","label":"yarn"},{"cmd":"pnpm add pouchdb-adapter-websql-core","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core PouchDB library; adapter is a plugin for PouchDB","package":"pouchdb","optional":false}],"imports":[{"note":"The adapter must be plugged into PouchDB; direct import alone does nothing.","wrong":"const WebSQLAdapter = require('pouchdb-adapter-websql-core');","symbol":"default export","correct":"import PouchDB from 'pouchdb'; import WebSQLAdapter from 'pouchdb-adapter-websql-core'; PouchDB.plugin(WebSQLAdapter);"}],"quickstart":{"code":"import PouchDB from 'pouchdb';\nimport WebSQLAdapter from 'pouchdb-adapter-websql-core';\n\n// Register the adapter\nPouchDB.plugin(WebSQLAdapter);\n\n// Create a database using the WebSQL adapter\nconst db = new PouchDB('mydb', { adapter: 'websql' });\n\ndb.put({ _id: 'doc1', name: 'Test' }).then(() => {\n  return db.get('doc1');\n}).then(doc => {\n  console.log(doc);\n}).catch(err => {\n  console.error(err);\n});","lang":"typescript","description":"Shows how to import WebSQL core adapter and create a PouchDB instance using the WebSQL adapter."},"warnings":[{"fix":"Install with npm install --save-exact pouchdb-adapter-websql-core","message":"This package does not follow semver; its version is pegged to PouchDB. Use exact versions (--save-exact) to avoid unintended breaking changes.","severity":"gotcha","affected_versions":">=7.0.0"},{"fix":"Switch to pouchdb-adapter-idb or pouchdb-adapter-idb-next","message":"WebSQL is deprecated in non-Chromium browsers (per W3C). Use IndexedDB (pouchdb-adapter-idb) for cross-browser support.","severity":"deprecated","affected_versions":">=7.0.0"},{"fix":"Call PouchDB.plugin(WebSQLAdapter) before creating a database with adapter: 'websql'","message":"The adapter must be registered via PouchDB.plugin(); simply importing it does not activate the adapter.","severity":"gotcha","affected_versions":">=7.0.0"},{"fix":"Use .then()/catch() or async/await instead of callbacks","message":"Version 7.0.0 dropped support for callbacks; promises are required.","severity":"breaking","affected_versions":">=7.0.0"}],"env_vars":null,"search_vec":"'7.0.0':20 'adapt':4,6,49 'api':53 'backend':16 'base':14 'browser':56 'code':7 'cordova/phonegap':62 'core':3 'databas':67 'deprec':54 'direct':44,85 'enabl':63 'end':46 'environ':69 'first':66 'follow':31 'indexeddb':71 'instal':84 'intend':35 'intern':5 'javascript':86 'leverag':50 'mobil':60 'monorepo':80 'offlin':65 'offline-first':64 'packag':28 'part':76 'peg':22 'plugin':42 'pouchdb':1,18,24,39,79 'provid':8 'rare':83 'releas':26 'semver':32 'sqlite':13,58 'sqlite-bas':12 'storag':15 'unavail':73 'use':37 'user':47 'version':19 'via':61 'websql':2,10,52","created_at":"2026-06-07T12:56:50.837809+00:00","updated_at":"2026-06-07T12:56:50.837809+00:00","problems":[{"fix":"Register adapter: PouchDB.plugin(WebSQLAdapter). Use in Chromium-based browser or Cordova.","cause":"WebSQL adapter not registered; or environment does not support WebSQL (e.g., Node.js, non-Chromium browsers).","error":"Error: adapter is not defined / websql is not available"},{"fix":"Ensure both PouchDB and the adapter use the same module system (ESM or CJS). Import PouchDB first.","cause":"PouchDB and the adapter are loaded incorrectly (likely mixed CJS/ESM or missing PouchDB import).","error":"TypeError: PouchDB.plugin is not a function"},{"fix":"Run: npm install --save-exact pouchdb-adapter-websql-core","cause":"Package not installed or version mismatch.","error":"Cannot find module 'pouchdb-adapter-websql-core'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/pouchdb/pouchdb#readme","github":"https://github.com/pouchdb/pouchdb","docs":null,"changelog":null,"pypi":null,"npm":"pouchdb-adapter-websql-core","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}