{"id":44623,"library":"cordova-sqlite-ext","title":"Cordova SQLite Ext","description":"Cordova SQLite Ext (v7.0.0) provides a native SQLite interface for Cordova/PhoneGap apps with extra features like BASE64, REGEXP, and pre-populated databases. It supports Android, iOS, macOS, and Windows 10 (UWP). Based on the HTML5 Web SQL API, it addresses the multiple SQLite corruption issue and has breaking changes in upcoming major releases. Compared to the core cordova-sqlite-storage plugin, this version adds REGEXP and BASE64 support. The plugin uses a before_plugin_install hook to fetch dependencies from npm. MIT licensed with Apache 2.0 option on Android/Windows. Not heavily maintained; consider alternatives for new projects.","status":"maintenance","version":"7.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/litehelpers/cordova-sqlite-ext","tags":["javascript","sqlite","ecosystem:cordova","cordova-android","cordova-ios","cordova-osx","cordova-windows"],"install":[{"cmd":"npm install cordova-sqlite-ext","lang":"bash","label":"npm"},{"cmd":"yarn add cordova-sqlite-ext","lang":"bash","label":"yarn"},{"cmd":"pnpm add cordova-sqlite-ext","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Installed via before_plugin_install hook for SQLite3 libraries","package":"cordova-sqlite-ext-deps","optional":true}],"imports":[{"note":"Plugin exposes itself as window.sqlitePlugin after device ready; no ES module import.","wrong":"import sqlitePlugin from 'cordova-sqlite-ext';","symbol":"window.sqlitePlugin","correct":"var sqlitePlugin = window.sqlitePlugin;"},{"note":"OpenDatabase is a method on sqlitePlugin object, not the global Web SQL function. Location must be 'default' instead of numeric values since breaking changes.","wrong":"var db = openDatabase('my.db', '1.0', 'description', 50000);","symbol":"openDatabase","correct":"var db = window.sqlitePlugin.openDatabase({name: 'my.db', location: 'default'});"},{"note":"Queries are executed inside transactions; executeSql is asynchronous with callbacks, not synchronous.","wrong":"var results = db.executeSql('SELECT 1');","symbol":"SQLResultSet","correct":"db.transaction(function(tx) { tx.executeSql('SELECT ?', [1], function(tx, results) { console.log(results.rows.length); }); });"}],"quickstart":{"code":"// Wait for device ready\ndocument.addEventListener('deviceready', function() {\n  var db = window.sqlitePlugin.openDatabase({\n    name: 'mydb.sqlite',\n    location: 'default'\n  });\n  db.transaction(function(tx) {\n    tx.executeSql('CREATE TABLE IF NOT EXISTS test (id integer primary key, value text)');\n    tx.executeSql('INSERT INTO test VALUES (?, ?)', [1, 'test'], function(tx, res) {\n      console.log('insertId: ' + res.insertId + ' rowsAffected: ' + res.rowsAffected);\n    });\n    tx.executeSql('SELECT * FROM test', [], function(tx, res) {\n      var len = res.rows.length;\n      for (var i = 0; i < len; i++) {\n        var row = res.rows.item(i);\n        console.log('Row: ' + row.id + ' ' + row.value);\n      }\n      alert('Query completed');\n    });\n  }, function(err) {\n    console.log('Transaction ERROR: ' + err.message);\n  });\n});","lang":"javascript","description":"Shows basic database creation, table creation, insert, and select inside a transaction using the plugin API after device ready."},"warnings":[{"fix":"Use latest version and consider androidDatabaseProvider: 'system' on Android to reduce risk.","message":"Multiple SQLite corruption problem - see GitHub issue #626","severity":"breaking","affected_versions":"all"},{"fix":"Do not rely on error.code for logic; parse error.message instead.","message":"Error code will always be 0 in upcoming major release; actual SQLite3 error code in message","severity":"breaking","affected_versions":"<8.0.0"},{"fix":"Replace location:0 with location:'default' or iosDatabaseLocation:'default'.","message":"Location numeric values (0-2) deprecated, use 'default' or iosDatabaseLocation","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Omit androidLockWorkaround unless necessary; prefer androidDatabaseProvider: 'system'.","message":"androidLockWorkaround:1 may cause issues; only use if needed","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'10':34 '2.0':91 'add':69 'address':44 'altern':99 'android':29,109 'android/windows':94 'apach':90 'api':42 'app':15 'base':36 'base64':20,72 'break':52 'chang':53 'compar':58 'consid':98 'cordova':1,4,63,106,108,111,114,117 'cordova-android':107 'cordova-io':110 'cordova-osx':113 'cordova-sqlite-storag':62 'cordova-window':116 'cordova/phonegap':14 'core':61 'corrupt':48 'databas':26 'depend':84 'ecosystem':105 'ext':3,6 'extra':17 'featur':18 'fetch':83 'heavili':96 'hook':81 'html5':39 'instal':80 'interfac':12 'io':30,112 'issu':49 'javascript':103 'licens':88 'like':19 'maco':31 'maintain':97 'major':56 'mit':87 'multipl':46 'nativ':10 'new':101 'npm':86 'option':92 'osx':115 'plugin':66,75,79 'popul':25 'pre':24 'pre-popul':23 'project':102 'provid':8 'regexp':21,70 'releas':57 'sql':41 'sqlite':2,5,11,47,64,104 'storag':65 'support':28,73 'upcom':55 'use':76 'uwp':35 'v7.0.0':7 'version':68 'web':40 'window':33,118","created_at":"2026-06-07T12:51:02.006012+00:00","updated_at":"2026-06-07T12:51:02.006012+00:00","problems":[{"fix":"Wait for deviceready event and verify plugin installation with cordova plugin list.","cause":"Code runs before deviceready event or plugin not installed properly","error":"Error: No sqlitePlugin found"},{"fix":"Ensure all SQLite calls are inside deviceready callback.","cause":"window.sqlitePlugin not available yet","error":"TypeError: Cannot read property 'openDatabase' of undefined"},{"fix":"Manually run npm install cordova-sqlite-ext-deps in the plugin directory or use --nofetch.","cause":"Missing dependencies or network issue during before_plugin_install hook","error":"cordova plugin add cordova-sqlite-ext fails with npm error"}],"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/litehelpers/cordova-sqlite-ext","github":"https://github.com/litehelpers/cordova-sqlite-ext","docs":null,"changelog":null,"pypi":null,"npm":"cordova-sqlite-ext","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}}