While the official SQLite WASM build is excellent, setting it up with the Origin Private File System (OPFS), handling the Web Worker communication, and ensuring concurrency safety (Mutex) involves a fair amount of boilerplate.
This library handles: - *Worker Orchestration*: Spawns and manages the SQLite worker. - *Persistence*: Automatically uses OPFS for file storage. - *SharedArrayBuffer Support*: Required for high-performance VFS. - *Safe Concurrency*: A built-in Mutex ensures that SQL commands and transactions are executed sequentially even if called concurrently from the main thread.
It’s designed for "local-first" apps where you want the reliability of a relational database without needing a backend for every query.
GitHub: https://github.com/wuchuheng/web-sqlite-js Docs: https://web-sqlite-js.wuchuheng.com
I'd love to hear your thoughts on the approach or any feedback on the API design.