@txfence/storage-sqlite
SQLite ReceiptStore implementation for local development and single-process staging environments.
Installation
npm install @txfence/storage-sqlite better-sqlite3Setup
import { createSqliteReceiptStore, initSchema } from '@txfence/storage-sqlite'
import Database from 'better-sqlite3'
const db = new Database('./receipts.db')
initSchema(db)
const receiptStore = createSqliteReceiptStore(db)initSchema is synchronous and idempotent.
In-memory database
For tests, pass ':memory:':
const db = new Database(':memory:')Options
createSqliteReceiptStore(db, { tableName: 'txfence_receipts' })When to use
SQLite for local development and single-process staging. PostgreSQL (@txfence/storage-pg) for production multi-process deployments where multiple agents write concurrently.
Last updated on