Skip to content

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented Jan 16, 2025

Update package:sqlite3 and package:sqlite3_web. This changes:

  • The sqlite3 package now provides commit and rollback notifications. That causes compilation errors in our ThrottledDatabase wrapper. That's not a huge problem because that class is only imported in workers (which we provide for users) and existing compiled workers are compatible with the updated sqlite3 package. This PR adds the missing methods.
  • Also, sqlite3_web added support for accessing databases in the same context (so without a worker). To support this in sqlite3_async (and later the PowerSync SDK as well), the AsyncSqliteController now needs to be injected when opening WebSqlite (previously, the controller was only part of the worker).
    • I've also added a public interface which allows package:powersync_core to inject its own controller (since the same thing applies - previously this was only part of the db worker, now we might also need it in the main context).
  • Finally, I've also replaced the legacy web-interop libraries from the SDK with the newer ones.

@simolus3 simolus3 changed the title Support running without web workers Update package:sqlite3, migrate to new interop APIs Jan 21, 2025
@simolus3 simolus3 marked this pull request as ready for review January 21, 2025 10:53
rkistner
rkistner previously approved these changes Jan 21, 2025
stevensJourney
stevensJourney previously approved these changes Jan 21, 2025
Copy link
Contributor

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

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

Looks good from my side.

@simolus3 simolus3 dismissed stale reviews from stevensJourney and rkistner via 31d6b56 January 21, 2025 14:41
@simolus3 simolus3 merged commit b20b3b3 into main Jan 21, 2025
7 checks passed
@simolus3 simolus3 deleted the feat/optional-workers branch January 21, 2025 15:37
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