React hook wrapping the capacitor-data-storage-sqlite plugin to provide a simple key-value store with SQLite persistence for Capacitor 5 apps. Version 3.0.2 is current; it requires @capacitor/core ^5.0.0 and react ^18.0.0. The hook exposes functions like setItem, getItem, getAllKeys, and JSON import/export, running natively on iOS, Android, and the web. Unlike generic storage hooks, this one leverages Capacitor's SQLite plugin for structured data operations including table management and filtering. Low download counts and single maintainer indicate limited community adoption.
npm install react-data-storage-sqlite-hookNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows opening a store, setting and getting an item, then closing the store inside useEffect.
Ensure openStore() is awaited before calling setItem, getItem, etc.
Always use await inside async functions (e.g., event handlers, useEffect async wrappers).
Check documentation; prefer omitting closeStore() if the store lifecycle is automatic.
Use version 2.x for Capacitor 4, or upgrade your project to Capacitor 5.
Use JSON.stringify before setItem and JSON.parse after getItem for non-string data.
Ensure the hook is used inside a React functional component and Capacitor.isNativePlatform() checks if needed.
Move openStore() call to the top of your async function and await it before other operations.
Run: npm install capacitor-data-storage-sqlite (the peer dependency).