Use Node.js native sqlite instead of better-sqlite3#1357
Merged
f-f merged 3 commits intopurescript:masterfrom Jan 24, 2026
Merged
Use Node.js native sqlite instead of better-sqlite3#1357f-f merged 3 commits intopurescript:masterfrom
f-f merged 3 commits intopurescript:masterfrom
Conversation
Contributor
|
Maybe it is better to move to nodejs build-in sql support https://nodejs.org/api/sqlite.html (available from Node 22) Spago next is a new tool and still not widely used so I don't think that there need to worry about old node version and ignore node platform development. |
Contributor
Author
|
@wclr sure, let's get some buy-in first from the maintainers and then we can also go that route. Main motivation is to avoid having to rebuild spago for different node versions. |
f-f
reviewed
Jan 18, 2026
f32efe6 to
295c45b
Compare
6c5b095 to
ee35778
Compare
- Use Node.js native node:sqlite module (available from Node 22.5.0) - Add Node.js version check at startup - Add engines field to package.json - Use named parameters consistently in SQL queries - Suppress ExperimentalWarning for node:sqlite in shebang and CI Benefits: - Zero native compilation dependencies (no node-gyp) - Built-in Node.js module - will stabilize over time - Same performance - local file-based SQLite database
79dfca7 to
06d9e75
Compare
node:sqlite has locking issues on Windows where rapid sequential inserts fail with 'database is locked' even with timeout set. Using BEGIN IMMEDIATE acquires the lock once for all inserts.
4e624ef to
30d641a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace
better-sqlite3with Node.js nativenode:sqlitemodule.@paramwith object argument)ExperimentalWarningin CLI and tests