A unified SQLite interface for Node.js and React Native, allowing the same codebase to run SQLite queries on both platforms. Current stable version is 1.0.4, with ongoing development (monthly releases). It provides simple execute, batch, and query methods, with built-in TypeScript types. Unlike other adapters (like react-native-sqlite-storage), it abstracts away platform-specific implementations and provides a consistent Promise-based API. Note: browser support is not yet implemented.
npm install any-sqliteNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Opens a SQLite database, creates a table, inserts a row, and queries all rows.
Test your queries on both platforms and avoid relying on edge cases.
Expect potential breaking changes and pin version or check changelog before upgrading.
Ensure each element in the batch array is an array, e.g., [['INSERT INTO t VALUES (?)', [1]], ['INSERT INTO t VALUES (?)', [2]]].
Check the return value format across platforms or use a wrapper to normalize.
Do not use this package in browser environments; consider sql.js or sqlite3.js instead.
Install better-sqlite3: npm install better-sqlite3
Use import { open } from 'any-sqlite' and call open() to get db.Install react-native-sqlite-storage: npm install react-native-sqlite-storage
Link the native module: npx react-native link react-native-sqlite-storage