{"id":44617,"library":"cordova-sqlcipher-adapter","title":"Cordova SQLCipher Adapter","description":"Native SQLCipher version 4 database adapter for Cordova/PhoneGap applications on Android, iOS, and macOS platforms, based on cordova-sqlite-storage. Version 0.6.0 is stable but in maintenance-only mode (no active development). It provides an HTML5 Web SQL API-compatible interface with encrypted SQLite databases via SQLCipher. Key differentiators include free MIT license (with Apache 2.0 option for Android) and support for multiple platforms, but it suffers from known limitations: multiple SQLite corruption problems, Windows 10 UWP support disabled, and armeabi CPU support dropped. Alternative plugins with commercial licenses offer lighter resource usage. Breaking changes are pending in an upcoming major release.","status":"maintenance","version":"0.6.0","language":"javascript","source_language":"en","source_url":"https://github.com/brodybits/cordova-sqlcipher-adapter","tags":["javascript","sqlite","sqlcipher","ecosystem:cordova","cordova-android","cordova-ios","cordova-osx","cordova-windows"],"install":[{"cmd":"npm install cordova-sqlcipher-adapter","lang":"bash","label":"npm"},{"cmd":"yarn add cordova-sqlcipher-adapter","lang":"bash","label":"yarn"},{"cmd":"pnpm add cordova-sqlcipher-adapter","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Cordova framework required for native plugin integration","package":"cordova","optional":false}],"imports":[{"note":"ESM import not officially supported; typically used via script tag or window.sqlitePlugin. The plugin is injected as window.sqlitePlugin after installation and platform build.","wrong":"const sqlitePlugin = require('cordova-sqlcipher-adapter');","symbol":"default","correct":"import sqlitePlugin from 'cordova-sqlcipher-adapter';"},{"note":"The SQLitePlugin constructor is exported, but usage via window.sqlitePlugin is more common.","wrong":"const SQLitePlugin = require('cordova-sqlcipher-adapter').SQLitePlugin;","symbol":"SQLitePlugin","correct":"import { SQLitePlugin } from 'cordova-sqlcipher-adapter';"},{"note":"The traditional openDatabase and deleteDatabase functions are available on window.sqlitePlugin after deviceready.","wrong":"const { openDatabase } = require('cordova-sqlcipher-adapter');","symbol":"SQLiteFactory","correct":"// Not exported as a named import; use window.sqlitePlugin directly."}],"quickstart":{"code":"// Ensure plugin is installed and deviceready fired\ndocument.addEventListener('deviceready', () => {\n  const db = window.sqlitePlugin.openDatabase({name: 'test.db', location: 'default', key: 'password'});\n  db.transaction((tx) => {\n    tx.executeSql('CREATE TABLE IF NOT EXISTS test (id integer primary key, value text)');\n    tx.executeSql('INSERT INTO test VALUES (?,?)', [1, 'hello']);\n  });\n  db.transaction((tx) => {\n    tx.executeSql('SELECT * FROM test', [], (tx, res) => {\n      console.log('Result:', res.rows.item(0));\n    });\n  });\n  db.executeSql('SELECT * FROM test', [], (res) => {\n    console.log('Batch result:', res);\n  });\n}, false);","lang":"javascript","description":"Opens an encrypted SQLite database with SQLCipher, creates a table, inserts a row, and queries it using both transaction and batch execution."},"warnings":[{"fix":"Consider using alternative plugins (cordova-sqlite-evcore-extbuild-free or commercial) or upgrading to upcoming major release (if available).","message":"Multiple SQLite corruption problem exists in Android, iOS, and macOS - see issue #626","severity":"breaking","affected_versions":"<=0.6.0"},{"fix":"Use a different Cordova SQLite plugin for Windows or target Android/iOS/macOS only.","message":"Windows 10 (UWP) support is disabled due to major limitations","severity":"breaking","affected_versions":">=0.3.0 <=0.6.0"},{"fix":"Update target Android to 5.0+ or use armeabi-v7a compatible device.","message":"Extra-old armeabi CPU for Android pre-5.0 is no longer supported","severity":"deprecated","affected_versions":">=0.3.0"},{"fix":"Always backup the password and ensure it is safely stored (e.g., using device secure storage).","message":"Without the database password there is no proven way to recover the data.","severity":"gotcha","affected_versions":"all"},{"fix":"Adapt error handling to rely on message strings rather than error codes.","message":"Error code will always be 0 for all errors in upcoming major release (breaking change).","severity":"gotcha","affected_versions":">=0.3.0"}],"env_vars":null,"search_vec":"'0.6.0':26 '10':82 '2.0':62 '4':7 'activ':36 'adapt':3,9 'altern':91 'android':14,65,116 'apach':61 'api':45 'api-compat':44 'applic':12 'armeabi':87 'base':19 'break':100 'chang':101 'commerci':94 'compat':46 'cordova':1,22,113,115,118,121,124 'cordova-android':114 'cordova-io':117 'cordova-osx':120 'cordova-sqlite-storag':21 'cordova-window':123 'cordova/phonegap':11 'corrupt':79 'cpu':88 'databas':8,51 'develop':37 'differenti':55 'disabl':85 'drop':90 'ecosystem':112 'encrypt':49 'free':57 'html5':41 'includ':56 'interfac':47 'io':15,119 'javascript':109 'key':54 'known':75 'licens':59,95 'lighter':97 'limit':76 'maco':17 'mainten':32 'maintenance-on':31 'major':107 'mit':58 'mode':34 'multipl':69,77 'nativ':4 'offer':96 'option':63 'osx':122 'pend':103 'platform':18,70 'plugin':92 'problem':80 'provid':39 'releas':108 'resourc':98 'sql':43 'sqlcipher':2,5,53,111 'sqlite':23,50,78,110 'stabl':28 'storag':24 'suffer':73 'support':67,84,89 'upcom':106 'usag':99 'uwp':83 'version':6,25 'via':52 'web':42 'window':81,125","created_at":"2026-06-07T12:51:00.875149+00:00","updated_at":"2026-06-07T12:51:00.875149+00:00","problems":[{"fix":"Run: cordova plugin add cordova-sqlcipher-adapter","cause":"Plugin not installed or not properly added to Cordova project.","error":"Error: Could not locate plugin 'cordova-sqlcipher-adapter'"},{"fix":"Wrap calls in document.addEventListener('deviceready', ...) and rebuild platform.","cause":"Calling plugin API before deviceready event or improper platform build.","error":"TypeError: window.sqlitePlugin is undefined"},{"fix":"Pass {name: 'db', key: 'yourPassword'} to openDatabase.","cause":"Missing key/password argument when opening database.","error":"SQLitePlugin.openDatabase: Invalid or missing required argument: 'key'"}],"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/brodybits/cordova-sqlcipher-adapter","github":"https://github.com/brodybits/cordova-sqlcipher-adapter","docs":null,"changelog":null,"pypi":null,"npm":"cordova-sqlcipher-adapter","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}}