Skip to content

Conversation

@stevensJourney
Copy link
Collaborator

Overview

I've noticed frequent database is locked errors when using the Node.js sdk for unit tests (using the node:sqlite implementation).

This seems to happen when the multiple read connections are concurrently opened. We set the journal mode to WAL on each of the read connections (concurrently).

We only need to set the journal mode once, with the writer connection. This updates the SDK to only set the journal mode for the writer connection.

I added a unit test which will fail on main, but passes on this branch.

@changeset-bot
Copy link

changeset-bot bot commented Oct 29, 2025

🦋 Changeset detected

Latest commit: a75a113

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@powersync/node Patch

Not sure what this means? Click here to learn what changesets are.

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

simolus3
simolus3 previously approved these changes Oct 29, 2025
Copy link
Contributor

@simolus3 simolus3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@stevensJourney stevensJourney marked this pull request as ready for review October 30, 2025 08:56
@stevensJourney stevensJourney merged commit b00e1ec into main Oct 30, 2025
9 checks passed
@stevensJourney stevensJourney deleted the node-sqlite-open branch October 30, 2025 09:13
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.

3 participants