A SQLite3 event database implementation for the Applesauce Nostr client library, providing persistent storage for Nostr events. Version 6.0.0 supports multiple SQLite backends: better-sqlite3 (Node.js), libsql (Turso), and native SQLite (Bun/Deno). It serves as a drop-in replacement for the default in-memory database, combining in-memory caching with SQLite persistence for optimal performance. Includes a built-in Nostr relay implementation. Released under MIT license. Key differentiator: full compatibility with applesauce-core, hybrid architecture, and support for major SQLite drivers.
npm install applesauce-sqliteNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a persistent SQLite-backed EventStore using better-sqlite3 and adds a Nostr event.
Update imports to use the correct subpath for your chosen SQLite driver.
Replace import with e.g. 'import { BetterSqlite3EventDatabase } from 'applesauce-sqlite/better-sqlite3''Install build tools or use libsql instead if you cannot compile native modules.
Use dynamic import() or switch to ESM (type: 'module' in package.json).
Provide a file path for persistent storage, or use ':memory:' intentionally for test/transient data.
Use import from 'applesauce-sqlite/better-sqlite3' (or libsql/native).
Use dynamic import() or convert your project to ESM.
Reinstall/rebuild better-sqlite3: npm rebuild better-sqlite3.