A Vue 3 composable (hook) wrapping @capacitor-community/sqlite for reactive database operations in Ionic/Capacitor apps. Current stable version v3.0.3 targets Capacitor 4 and Vue 3. Provides a simple useState-like API (useSqlite) with reactive state for queries, mutations, and transaction support. Unlike raw capacitor-community/sqlite, it integrates deeply with Vue's reactivity system, automatically triggering component re-renders on data changes. Ships TypeScript types. Supports iOS, Android, and Web with SQLite via Capacitor.
npm install vue-sqlite-hookNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize SQLite connection, open database, create table, and query data using the reactive composable.
Upgrade Capacitor and @capacitor-community/sqlite to version 4+
call openDB() in onMounted or before any database operation
replace 'useDatabase' import with 'useSqlite'
only call useSqlite() within component setup context
add '@capacitor-community/sqlite' web setup; ensure proper polyfills
await sqlite.openDB() before any CRUD operations
Create SQLiteConnection instance and pass to useSqlite