SQLite adapter for @epic-web/cachified, version 1.1.0, allowing use of SQLite as a cache backend for the caching library. Supports multiple SQLite libraries: better-sqlite3, sqlite, sqlite3, bun:sqlite, and node:sqlite. It provides separate subpath exports for each SQLite driver, ensuring type-safety with TypeScript. The adapter simplifies integration by handling table creation and cache operations. Key differentiator: compatibility with a wide range of SQLite drivers, while the base @epic-web/cachified only provides in-memory and Redis adapters out of the box. Regular updates follow the host library's release cadence.
npm install cachified-adapter-sqliteNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an in-memory SQLite cache using better-sqlite3 and retrieves a cached value with cachified.
Use import syntax or dynamic import. For Node.js, set type: "module" in package.json or use .mjs extension.
Install the peer dependency: npm install @epic-web/cachified@^5.2.0
Call create*CacheTable function (e.g., createBetterSqlite3CacheTable(database, tableName)) before creating the cache adapter.
Use the recommended driver versions (better-sqlite3 >=11.7.0, sqlite >=5.1.1, sqlite3 >=5.1.7).
Ensure Node.js version >=14.13 (or use --experimental-exports flag). Update to latest Node LTS.
Call createBetterSqlite3CacheTable(database, 'cache') or equivalent before creating the adapter.
Pass the correct database object from the corresponding SQLite library (e.g., new Database(...) from better-sqlite3).
Use correct subpath: /better-sqlite3, /sqlite, /sqlite3, /bun, or /node-sqlite.