Skip to content

Conversation

stevensJourney
Copy link
Contributor

Overview

#150 recently raised an issue with local only tables.

This was caused by incorrect serialisation of the provided Schema. Specifically, the JSON payload for the schema supplied camel case field names for localOnly, insertOnly and viewName instead of the required local_only, insert_only, and view_name parameters.

This PR updates the serialisation method to use the correct serial name when serialising the schema.

We recently got some feedback that @Serializable should be avoided for public interfaces/classes as these can increase the objective C header size for the Swift SDK. This PR also removes @Serializable from the Schema definition classes. We still use @Serializable for other public classes, this is not addressed in this PR. In practice the changes here make the header file about 25 lines smaller.

This PR also adds the ability to update the schema after a PowerSync client has been initialised.

@stevensJourney stevensJourney marked this pull request as ready for review March 27, 2025 09:46
@stevensJourney stevensJourney requested a review from simolus3 March 27, 2025 09:46
simolus3
simolus3 previously approved these changes Mar 27, 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.

I'm happy with these changes 👍

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.

Thanks!

@stevensJourney stevensJourney merged commit 3c234d5 into main Mar 27, 2025
3 checks passed
@stevensJourney stevensJourney deleted the update-schema branch March 27, 2025 10:59
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