web-sqlite-js v2.3.0 is a persistent, non-blocking SQLite database for the browser using OPFS and Web Workers. It offers type-safe TypeScript APIs, transaction support, schema migrations, and two-tier validation (v2.2.0+). Compared to alternatives like sql.js or sqlocal, it focuses on out-of-the-box persistence and concurrency safety via mutex, with built-in logging and enhanced error messages. Released under MIT license with monthly updates.
npm install web-sqlite-jsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates opening a database with schema migration, running queries, and using transactions.
Use await openDB(...) instead of openDB(..., callback).
Set 'Cross-Origin-Opener-Policy: same-origin' and 'Cross-Origin-Embedder-Policy: require-corp' on your server.
Replace `debug: true` with `onLog: (msg) => console.log(msg)`.
Keep database names consistent across app versions, or implement custom migration logic.
Use a single openDB instance per database; close old connections before opening new ones.
Use const openDB = require('web-sqlite-js').default;Add Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Embedder-Policy: require-corp headers.
Change to import openDB from 'web-sqlite-js' (no curly braces).
Always increment version and provide appropriate migration logic for each upgrade.
No dependency data recorded yet.