Skip to content

Conversation

@LucDeCaf
Copy link
Contributor

@LucDeCaf LucDeCaf commented Jan 26, 2026

Enables better syntax for building out the PowerSync schema. Related discussion can be found here.

The reasoning for using a new factory class instead of modifying the base Table class is that the syntax shown in this PR requires the properties being set to be mutable, but the Table class is not designed to be modified after construction. Therefore, we use a mutable factory class which can produce immutable Table classes. This PR also restricts access to Table's accessers in order to reflect this change.

Breaking changes:

  • Table name must now be passed in the Table constructor instead of in the Schema constructor
  • Some fields in PowerSync.Common.DB.Schema.Table have been made private/readonly
  • Renamed ColumnType enum from SCREAMING_SNAKE_CASE to PascalCase

@LucDeCaf LucDeCaf marked this pull request as ready for review January 27, 2026 08:38
@LucDeCaf LucDeCaf requested a review from Chriztiaan January 27, 2026 11:35
@LucDeCaf LucDeCaf changed the title Schema builder syntax Schema factory syntax Jan 29, 2026
@LucDeCaf LucDeCaf requested a review from Chriztiaan January 29, 2026 14:43
@LucDeCaf LucDeCaf merged commit 00cea74 into main Feb 2, 2026
1 check passed
@LucDeCaf LucDeCaf deleted the feat/schema-builder branch February 2, 2026 09:16
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