-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
sqlite: allow passing conflict resolution handler function #56352
sqlite: allow passing conflict resolution handler function #56352
Conversation
552a1e8
to
933ce21
Compare
933ce21
to
3635cd9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of quick observations about callback handling.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #56352 +/- ##
========================================
Coverage 88.54% 88.54%
========================================
Files 657 657
Lines 190395 190718 +323
Branches 36552 36601 +49
========================================
+ Hits 168586 168877 +291
- Misses 14992 15021 +29
- Partials 6817 6820 +3
|
f63c3b4
to
a06a068
Compare
@cjihrig Could you run CI? |
Looks like a flaky test. Needs a re-run I think. |
@cjihrig Thanks for the review. Could you trigger another CI run? |
Landed in 0dbbaba |
PR-URL: #56352 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Resolves #56210 by allowing to pass a conflict resolution handler that returns a conflict resolution type instead of just a conflict resolution type.
As @Renegade334 points out in that issue, it does not make sense to pass
SQLITE_CHANGESET_REPLACE
because this conflict resolution type is only valid for certain conflict types. Therefore an API where the conflict-resolution handler receives the conflict type makes sense, so the user can return a valid conflict resolution type for a particular conflict type.An API where an individual (conflicting) change can be inspected (as is possible with the SQLite C conflict handler) would be a good follow-up. This would then be added as a second argument to the conflict handler.
Note that this is a breaking change, but since the SQLite module is experimental I don't think that is an issue.
Note: some of the documentation I added comes pretty much verbatim from the SQLite Documentation, but this is not an issue because the SQLite documentation is dedicated to the public domain. Also I linked to the SQLite documentation.