Skip to content

Add sync plan version 2#717

Merged
simolus3 merged 1 commit into
mainfrom
sync-plan-versioning
Jul 20, 2026
Merged

Add sync plan version 2#717
simolus3 merged 1 commit into
mainfrom
sync-plan-versioning

Conversation

@simolus3

@simolus3 simolus3 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

#703 introduced syntax exposing table and schema names to bucket data and parameter creators, a change that requires changes to the serialized form of sync plans.

Older service versions would not load these correctly, so they should reject those plans outright. The version field added to sync plans helps here, older services throw if it's not 1. This PR:

  1. Introduces version 2 for sync plans, used when .schema(), .table_suffix() or .table_name() are used in an expression of the sync plan. Existing deployments not using the new row metadata functions are unaffected.
  2. Improves the error message when we encounter sync plan versions the current service doesn't understand (this only starts being relevant when we increase the version again in the future, but it's helpful to have).

By continuing to use plan version 1 where possible, we allow service downgrades as long as the new functions aren't used in sync plans (if there are, there's no way an older service could implement those streams either way).

@changeset-bot

changeset-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 861bb02

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

This PR includes changesets to release 20 packages
Name Type
@powersync/service-errors Minor
@powersync/service-module-mongodb Patch
@powersync/service-module-mysql Patch
@powersync/service-module-mssql Patch
@powersync/service-module-convex Patch
@powersync/service-sync-rules Minor
@powersync/service-module-postgres Minor
@powersync/lib-services-framework Patch
@powersync/service-schema Patch
@powersync/service-image Patch
@powersync/service-jpgwire Patch
@powersync/service-core-tests Patch
@powersync/service-core Patch
@powersync/service-module-mongodb-storage Patch
@powersync/service-module-postgres-storage Patch
@powersync/service-rsocket-router Patch
@powersync/lib-service-mongodb Patch
@powersync/lib-service-postgres Patch
@powersync/service-module-core Patch
test-client 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 force-pushed the sync-plan-versioning branch from 861bb02 to 56590b8 Compare July 15, 2026 12:37
@simolus3
simolus3 marked this pull request as ready for review July 15, 2026 12:57
@simolus3
simolus3 requested a review from stevensJourney July 15, 2026 12:58

@stevensJourney stevensJourney left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The changes here look good to me.

@simolus3
simolus3 merged commit cb4c627 into main Jul 20, 2026
46 checks passed
@simolus3
simolus3 deleted the sync-plan-versioning branch July 20, 2026 14:18
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