Skip to content

Conversation

Chriztiaan
Copy link
Contributor

@Chriztiaan Chriztiaan commented Sep 20, 2024

The rawTableNames field in SQLWatchOptions has been deprecated. Now, all tables specified in the tables option will be watched, including PowerSync tables with prefixes.

As part of this update, I reviewed how the Dart SDK handles the triggerOnTables input here. In the Dart SDK, the tables specified are expanded into tableName, ps_data__tableName, and ps_data_local__tableName.

However, because of how onChange and watch are currently used (watch invokes onChange), table expansion cannot occur in watch. Therefore, table expansion now happens in onChange and tables are always mapped from ps_data_tableName/ps_data_local__tableName to tableName.

One issue with the rawTableNames: true option was that specifying a view name (such as lists) wouldn’t trigger onChange or watch. This issue has now been resolved as part of these changes.

Basic test

Now with unit tests 😇

Copy link

changeset-bot bot commented Sep 20, 2024

🦋 Changeset detected

Latest commit: 2f0c0c1

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

This PR includes changesets to release 4 packages
Name Type
@powersync/common Minor
@powersync/react-native Patch
@powersync/web Patch
@powersync/diagnostics-app 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

@Chriztiaan Chriztiaan marked this pull request as ready for review September 20, 2024 12:42
stevensJourney
stevensJourney previously approved these changes Sep 25, 2024
Copy link
Collaborator

@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.

LGTM

@Chriztiaan Chriztiaan merged commit 9dea1b9 into main Sep 25, 2024
5 checks passed
@Chriztiaan Chriztiaan deleted the deprecate/raw-tables branch September 25, 2024 15:50
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