Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add _updateSchema functionality #5003

Merged
merged 1 commit into from
Oct 12, 2022
Merged

Add _updateSchema functionality #5003

merged 1 commit into from
Oct 12, 2022

Conversation

gagik
Copy link
Contributor

@gagik gagik commented Oct 11, 2022

What, How & Why?

Add the ability to update schema to the bindgen repository.

This closes #4959

☑️ ToDos

  • 📝 Changelog entry
  • 📝 Compatibility label is updated or copied from previous entry
  • 📝 Update COMPATIBILITY.md
  • 🚦 Tests
  • 🔀 Executed flexible sync tests locally if modifying flexible sync
  • 📦 Updated internal package version in consuming package.jsons (if updating internal packages)
  • 📱 Check the React Native/other sample apps work if necessary
  • 📝 Public documentation PR created or is not necessary
  • 💥 Breaking label has been applied or is not necessary

If this PR adds or changes public API's:

  • typescript definitions file is updated
  • jsdoc files updated
  • Chrome debug API is updated if API is available on React Native

@cla-bot cla-bot bot added the cla: yes label Oct 11, 2022
packages/realm/src/index.ts Outdated Show resolved Hide resolved
@@ -667,6 +667,8 @@ classes:
read_group: () -> Group&
duplicate: () -> TransactionRef

update_schema: '(schema: std::vector<ObjectSchema>, version: uint64_t, migration_function: Nullable<std::function<(old_realm: SharedRealm, new_realm: SharedRealm, new_schema_handle: Schema&) -> void>>, initialization_function: Nullable<std::function<(realm: SharedRealm) -> void>>, in_transaction: bool) -> void'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

considering this is just being set to null, could I set those functions to just be regular Nullable<() -> void> arguments?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think the generated C++ would like that .. cc @RedBeard0531?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I played around with this just now and it does seem like this would not work. So I will just leave it this way, if this ends up being jarring we could introduce type aliases but it's not that much longer than other functions like this.

@gagik gagik force-pushed the gagik/updateschema branch from 9f0b01b to 4dd4f37 Compare October 11, 2022 15:09
@gagik gagik requested a review from kraenhansen October 11, 2022 15:11
@gagik gagik force-pushed the gagik/updateschema branch from 4dd4f37 to 4bcb942 Compare October 12, 2022 11:15
@gagik gagik merged commit 6f49ce1 into bindgen Oct 12, 2022
@gagik gagik deleted the gagik/updateschema branch October 12, 2022 12:34
kraenhansen pushed a commit that referenced this pull request Oct 24, 2022
kraenhansen pushed a commit that referenced this pull request Oct 26, 2022
RedBeard0531 pushed a commit that referenced this pull request Nov 15, 2022
RedBeard0531 pushed a commit that referenced this pull request Nov 23, 2022
takameyer pushed a commit that referenced this pull request Dec 28, 2022
kraenhansen pushed a commit that referenced this pull request Mar 1, 2023
kraenhansen pushed a commit that referenced this pull request Mar 3, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants