Skip to content

Node: Support using node:sqlite driver #690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Node: Support using node:sqlite driver #690

wants to merge 2 commits into from

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented Aug 8, 2025

This adds work-in-progress support for using node:sqlite3 as a driver in addition to better-sqlite3. Because there are no update hooks in that driver, this requires powersync-ja/powersync-sqlite-core#120 to be released first.

Most tests seem to work, but there are some failures I still need to investigate. We also need to figure out how to import node:sqlite properly, we can't use a regular import because node:sqlite is not available on older Node versions we still want to support. A dynamic import seems to work for ESM, but rollup doesn't properly translate it to a require call.

Copy link

changeset-bot bot commented Aug 8, 2025

⚠️ No Changeset found

Latest commit: 2579765

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@rkistner
Copy link
Contributor

rkistner commented Aug 8, 2025

This looks quite promising!

If this works well, we could perhaps switch to node:sqlite by default when we do a v1.0 release, moving better-sqlite3 support to a separate package or import (removing it from the default dependencies).

I'm also wondering: Could we use the same approach for update notifications for better-sqlite3? Would that allow us to switch back to upstream better-sqlite3, or are there other blockers currently?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants