Tutorialwork / cloud_kit

Flutter plugin to use CloudKit in your iOS app
https://pub.dev/packages/cloud_kit
GNU General Public License v3.0
14 stars 9 forks source link

Update Entry #7

Open nicop2000 opened 1 year ago

nicop2000 commented 1 year ago

How to update an entry?

ivofernandes commented 1 year ago

The idea is to delete and save again, but the delete is bugged, will create a pull request next week I guess

mattrltrent commented 3 months ago

There really should be an upsert operation.

ivofernandes commented 3 months ago

@mattrltrent Is just a delete followed by an add

mattrltrent commented 3 months ago

@ivofernandes This isn't atomic though? Let's say you want to guarantee your existing key is either updated or left alone. With this current implementation, that seems impossible. This is because the delete could succeed, but saving a new value could fail.

ivofernandes commented 3 months ago

I guess for that you need to dive into iOS cloudkit documentation and see if there are other methods besides what this package is using?

SethuSenthil commented 1 month ago

Yup, there seems to be a decided update method as documented here: https://developer.apple.com/documentation/cloudkitjs/cloudkit/recordsbatchbuilder/1628739-update