Registry / storage / localforage-cordova-sq-lite-driver-ts

localforage-cordova-sq-lite-driver-ts

JSON →
library1.0.6jsnpmunverified

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.

npm install localforage-cordova-sq-lite-driver-ts
INSTALL
IMPORT
SIG · LOCALFORAGE-CORDOV
L
localforage-cordova-sq-lite-driver-ts
storagejavascriptv1.0.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CordovaSQLiteDriver
import { CordovaSQLiteDriver } from 'localforage-cordova-sq-lite-driver-ts'
const CordovaSQLiteDriver = require('localforage-cordova-sq-lite-driver-ts')
ESM-only; named export. CommonJS require will fail in Node environments.
CordovaSQLiteDriver._driver
CordovaSQLiteDriver._driver
CordovaSQLiteDriver.driver
The driver string is accessed via the _driver property, not a static driver property.
localforage (with driver)
import localforage from 'localforage'; localforage.defineDriver(CordovaSQLiteDriver).then(() => { localforage.setDriver([CordovaSQLiteDriver._driver]); })
localforage.setDriver('cordovaSQLiteDriver')
Driver must be defined before setting. Using string literal won't work because the driver is not pre-registered.

Shows how to define and set the SQLite driver with localforage, then store and retrieve a value.

import localforage from 'localforage'; import { CordovaSQLiteDriver } from 'localforage-cordova-sq-lite-driver-ts'; // Define the driver localforage.defineDriver(CordovaSQLiteDriver).then(() => { return localforage.setDriver([CordovaSQLiteDriver._driver]); }).then(() => { // Now you can use localforage as usual return localforage.setItem('key', 'value'); }).then(value => { console.log('Stored value:', value); }).catch(err => { console.error('Error:', err); });
Debug
Known issues
gotchaDriver must be defined before setting; calling setDriver without defineDriver will silently fall back to default.
fix
Always call localforage.defineDriver(CordovaSQLiteDriver) before localforage.setDriver([CordovaSQLiteDriver._driver]).
affects: >=0.0.0
breakingThe _driver property is typed as string; relying on it for driver ordering in Ionic's IonicStorageModule may break if internal structure changes.
fix
Use the static _driver property as shown in documentation; avoid duplicating the string literal.
affects: >=1.0.0
gotchaOnly works on actual device or emulator with cordova-plugin-sqlite-storke installed; will not work in browser.
fix
Ensure you are running on a device/emulator and have installed cordova-sqlite-storage.
affects: >=0.0.0
deprecatedNo deprecation warnings provided by this package; however, underlying cordova-sqlite-storage may have its own deprecations.
fix
Stay updated with cordova-sqlite-storage releases and migrate to Capacitor SQLite if needed.
affects: >=0.0.0
Errors
Common errors & fixes
Error: CordovaSQLiteDriver is not defined
Forgot to import CordovaSQLiteDriver before using it.
fix
Add import: import { CordovaSQLiteDriver } from 'localforage-cordova-sq-lite-driver-ts';
localforage.setDriver is not a function
localforage is not properly imported or initialized.
fix
Ensure localforage is imported: import localforage from 'localforage';
Failed to define driver: cordovaSQLiteDriver
Trying to define a driver with a string instead of the driver object.
fix
Use the imported CordovaSQLiteDriver object: localforage.defineDriver(CordovaSQLiteDriver);
TypeError: Cannot read properties of undefined (reading '_driver')
CordovaSQLiteDriver is undefined due to incorrect import path or bundling issue.
fix
Check import path: import { CordovaSQLiteDriver } from 'localforage-cordova-sq-lite-driver-ts'; Ensure module resolution works.
Upgrade
Version history
1.0.6latest on npm
Audit
Dependencies
cordova-sqlite-storagerequiredNative SQLite plugin required at runtime on device
localforagerequiredPeer dependency - driver extends localForage's driver API
Agent activity
46 hits · last 30 days
node
38
OpenAI (training)
1
Resources
localforage-cordova-sq-lite-driver-ts — npm install localforage-cordova-sq-lite-driver-ts · libregistry