{"id":45809,"library":"pouchdb-adapter-node-websql","title":"PouchDB Node WebSQL Adapter","description":"PouchDB adapter that uses Node.js-based SQLite (via node-websql) as its data store. Latest stable version is 7.0.0. This package is part of the PouchDB monorepo and targets Node.js environments only, providing a WebSQL-compatible backend. It is designed for use with PouchDB's plugin system and requires explicit registration. Not recommended for new projects; consider using pouchdb-adapter-leveldb or pouchdb-adapter-node-websql as part of PouchDB’s custom builds for better performance and modern SQLite bindings. The adapter name is 'websql'. Maintained by the PouchDB team.","status":"deprecated","version":"7.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/pouchdb/pouchdb","tags":["javascript"],"install":[{"cmd":"npm install pouchdb-adapter-node-websql","lang":"bash","label":"npm"},{"cmd":"yarn add pouchdb-adapter-node-websql","lang":"bash","label":"yarn"},{"cmd":"pnpm add pouchdb-adapter-node-websql","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"PouchDB core library required for adapter functionality.","package":"pouchdb-core","optional":false},{"reason":"WebSQL implementation for Node.js that this adapter wraps.","package":"node-websql","optional":false}],"imports":[{"note":"Adapter is not a standalone PouchDB; it must be used with pouchdb-core and registered via plugin.","wrong":"const PouchDB = require('pouchdb-adapter-node-websql');","symbol":"default","correct":"import PouchDB from 'pouchdb-core';\nimport pouchAdapterNodeWebsql from 'pouchdb-adapter-node-websql';\nPouchDB.plugin(pouchAdapterNodeWebsql);"},{"note":"CommonJS usage: must call the module as a function to register the adapter.","wrong":"var db = new PouchDB('mydb', {adapter: 'node-websql'});","symbol":"default","correct":"var PouchDB = require('pouchdb-core');\nrequire('pouchdb-adapter-node-websql')(PouchDB);\nvar db = new PouchDB('mydb', {adapter: 'websql'});"},{"note":"The adapter must be registered via plugin before use; otherwise adapter name 'websql' is unrecognized.","wrong":"var db = new PouchDB('mydb', {adapter: 'websql'}); without prior plugin registration","symbol":"plugin registration","correct":"PouchDB.plugin(require('pouchdb-adapter-node-websql'));"}],"quickstart":{"code":"const PouchDB = require('pouchdb-core');\nrequire('pouchdb-adapter-node-websql')(PouchDB);\nconst db = new PouchDB('my_database', { adapter: 'websql' });\ndb.put({ _id: 'test', name: 'Hello' }).then(() => {\n  return db.get('test');\n}).then(doc => {\n  console.log(doc.name);\n}).catch(err => console.error(err));","lang":"javascript","description":"Demonstrates PouchDB plugin registration and creating a database using the WebSQL adapter in Node.js."},"warnings":[{"fix":"Switch to pouchdb-adapter-leveldb or use PouchDB's default adapter for Node.","message":"pouchdb-adapter-node-websql is deprecated. Use pouchdb-adapter-leveldb or custom builds with SQLite support.","severity":"deprecated","affected_versions":">=7.0.0"},{"fix":"Use {adapter: 'websql'} when creating a PouchDB instance.","message":"The adapter name is 'websql', not 'node-websql' or 'sqlite'.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Call PouchDB.plugin(require('pouchdb-adapter-node-websql')) before creating any database instances.","message":"Adapter must be registered via PouchDB.plugin() before use; otherwise PouchDB will throw an error for unknown adapter.","severity":"gotcha","affected_versions":">=6.0.0"},{"fix":"Use pouchdb-adapter-websql for browser environments.","message":"This adapter only works in Node.js, not in browsers.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Install pouchdb-adapter-node-websql and register via plugin as shown.","message":"PouchDB 7.0.0 dropped default adapter auto-detection for node-websql; you must explicitly install and register this adapter.","severity":"breaking","affected_versions":">=7.0.0"}],"env_vars":null,"search_vec":"'7.0.0':24 'adapt':4,6,67,72,90 'backend':43 'base':10 'better':83 'bind':88 'build':81 'compat':42 'consid':63 'custom':80 'data':18 'design':46 'environ':36 'explicit':56 'javascript':99 'latest':20 'leveldb':68 'maintain':94 'modern':86 'monorepo':32 'name':91 'new':61 'node':2,14,73 'node-websql':13 'node.js':9,35 'packag':26 'part':28,76 'perform':84 'plugin':52 'pouchdb':1,5,31,50,66,71,78,97 'pouchdb-adapter-leveldb':65 'pouchdb-adapter-node-websql':70 'project':62 'provid':38 'recommend':59 'registr':57 'requir':55 'sqlite':11,87 'stabl':21 'store':19 'system':53 'target':34 'team':98 'use':8,48,64 'version':22 'via':12 'websql':3,15,41,74,93 'websql-compat':40","created_at":"2026-06-07T12:56:50.123973+00:00","updated_at":"2026-06-07T12:56:50.123973+00:00","problems":[{"fix":"const PouchDB = require('pouchdb-core'); require('pouchdb-adapter-node-websql')(PouchDB);","cause":"Adapter not registered via plugin before creating database.","error":"Error: unknown adapter \"websql\""},{"fix":"Install 'pouchdb-core' and import/require it, then use PouchDB.plugin(adapter).","cause":"Using pouchdb-adapter-node-websql directly instead of pouchdb-core.","error":"TypeError: PouchDB.plugin is not a function"},{"fix":"npm install pouchdb-adapter-node-websql","cause":"Package not installed or missing from node_modules.","error":"Module not found: Can't resolve 'pouchdb-adapter-node-websql'"}],"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-node-websql","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}}