{"id":45319,"library":"localforage-cordova-sq-lite-driver-ts","title":"localforage-cordova-sq-lite-driver-ts","description":"SQLite driver for Cordova and Capacitor apps using localForage. Version 1.0.6 provides a TypeScript-compatible driver for persisting data via SQLite on mobile devices, with active maintenance and TypeScript types bundled. Key differentiator: it's a maintained fork of the unmaintained localForage-cordovaSQLiteDriver, supporting Ionic and Capacitor projects.","status":"active","version":"1.0.6","language":"javascript","source_language":"en","source_url":"https://github.com/NLueg/localforage-cordova-sq-lite-driver","tags":["javascript","cordova","localforage","sqLite","ionic","capacitor","typescript"],"install":[{"cmd":"npm install localforage-cordova-sq-lite-driver-ts","lang":"bash","label":"npm"},{"cmd":"yarn add localforage-cordova-sq-lite-driver-ts","lang":"bash","label":"yarn"},{"cmd":"pnpm add localforage-cordova-sq-lite-driver-ts","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Native SQLite plugin required at runtime on device","package":"cordova-sqlite-storage","optional":false},{"reason":"Peer dependency - driver extends localForage's driver API","package":"localforage","optional":false}],"imports":[{"note":"ESM-only; named export. CommonJS require will fail in Node environments.","wrong":"const CordovaSQLiteDriver = require('localforage-cordova-sq-lite-driver-ts')","symbol":"CordovaSQLiteDriver","correct":"import { CordovaSQLiteDriver } from 'localforage-cordova-sq-lite-driver-ts'"},{"note":"The driver string is accessed via the _driver property, not a static driver property.","wrong":"CordovaSQLiteDriver.driver","symbol":"CordovaSQLiteDriver._driver","correct":"CordovaSQLiteDriver._driver"},{"note":"Driver must be defined before setting. Using string literal won't work because the driver is not pre-registered.","wrong":"localforage.setDriver('cordovaSQLiteDriver')","symbol":"localforage (with driver)","correct":"import localforage from 'localforage'; localforage.defineDriver(CordovaSQLiteDriver).then(() => { localforage.setDriver([CordovaSQLiteDriver._driver]); })"}],"quickstart":{"code":"import localforage from 'localforage';\nimport { CordovaSQLiteDriver } from 'localforage-cordova-sq-lite-driver-ts';\n\n// Define the driver\nlocalforage.defineDriver(CordovaSQLiteDriver).then(() => {\n  return localforage.setDriver([CordovaSQLiteDriver._driver]);\n}).then(() => {\n  // Now you can use localforage as usual\n  return localforage.setItem('key', 'value');\n}).then(value => {\n  console.log('Stored value:', value);\n}).catch(err => {\n  console.error('Error:', err);\n});","lang":"typescript","description":"Shows how to define and set the SQLite driver with localforage, then store and retrieve a value."},"warnings":[{"fix":"Always call localforage.defineDriver(CordovaSQLiteDriver) before localforage.setDriver([CordovaSQLiteDriver._driver]).","message":"Driver must be defined before setting; calling setDriver without defineDriver will silently fall back to default.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use the static _driver property as shown in documentation; avoid duplicating the string literal.","message":"The _driver property is typed as string; relying on it for driver ordering in Ionic's IonicStorageModule may break if internal structure changes.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Ensure you are running on a device/emulator and have installed cordova-sqlite-storage.","message":"Only works on actual device or emulator with cordova-plugin-sqlite-storke installed; will not work in browser.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Stay updated with cordova-sqlite-storage releases and migrate to Capacitor SQLite if needed.","message":"No deprecation warnings provided by this package; however, underlying cordova-sqlite-storage may have its own deprecations.","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'1.0.6':18 'activ':34 'app':14 'bundl':39 'capacitor':13,56,63 'compat':23 'cordova':3,11,59 'cordovasqlitedriv':52 'data':27 'devic':32 'differenti':41 'driver':6,9,24 'fork':46 'ionic':54,62 'javascript':58 'key':40 'lite':5 'localforag':2,16,51,60 'localforage-cordova-sq-lite-driver-t':1 'localforage-cordovasqlitedriv':50 'maintain':45 'mainten':35 'mobil':31 'persist':26 'project':57 'provid':19 'sq':4 'sqlite':8,29,61 'support':53 'ts':7 'type':38 'typescript':22,37,64 'typescript-compat':21 'unmaintain':49 'use':15 'version':17 'via':28","created_at":"2026-06-07T12:54:26.517969+00:00","updated_at":"2026-06-07T12:54:26.517969+00:00","problems":[{"fix":"Add import: import { CordovaSQLiteDriver } from 'localforage-cordova-sq-lite-driver-ts';","cause":"Forgot to import CordovaSQLiteDriver before using it.","error":"Error: CordovaSQLiteDriver is not defined"},{"fix":"Ensure localforage is imported: import localforage from 'localforage';","cause":"localforage is not properly imported or initialized.","error":"localforage.setDriver is not a function"},{"fix":"Use the imported CordovaSQLiteDriver object: localforage.defineDriver(CordovaSQLiteDriver);","cause":"Trying to define a driver with a string instead of the driver object.","error":"Failed to define driver: cordovaSQLiteDriver"},{"fix":"Check import path: import { CordovaSQLiteDriver } from 'localforage-cordova-sq-lite-driver-ts'; Ensure module resolution works.","cause":"CordovaSQLiteDriver is undefined due to incorrect import path or bundling issue.","error":"TypeError: Cannot read properties of undefined (reading '_driver')"}],"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/NLueg/localforage-cordova-sq-lite-driver#readme","github":"https://github.com/NLueg/localforage-cordova-sq-lite-driver","docs":null,"changelog":null,"pypi":null,"npm":"localforage-cordova-sq-lite-driver-ts","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage","mobile"],"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}}