-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
feat(orm): add API for batching updates and deletes while iterating #11156
Conversation
PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} | ||
KEY 010000047fffffffffffffff616263 10102203616263 | ||
PK testpb.ExampleTable 4/-1/abc -> {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} | ||
ORM UPDATE testpb.ExampleTable {"u32":4,"u64":16,"str":"abc","bz":"abc","i64":-1} -> {"u32":4,"u64":17,"str":"abc","bz":"abc","i64":-1} |
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.
@fdymylja one question I have is about the ordering of calls to Hooks
. You can see in the log here that the hook is called as soon as the write is batched, even though the actually SET and DELETE's are not applied later
Codecov Report
@@ Coverage Diff @@
## master #11156 +/- ##
==========================================
+ Coverage 65.76% 65.81% +0.04%
==========================================
Files 654 693 +39
Lines 66985 70149 +3164
==========================================
+ Hits 44052 46166 +2114
- Misses 20389 21152 +763
- Partials 2544 2831 +287
|
if hooks := writer.Hooks(); hooks != nil { | ||
err := hooks.OnInsert(new) | ||
if err != nil { | ||
return err |
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.
so hooks can stop the whole process?
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.
yes, I am going to separate before and after hooks though, and will put this in draft and add that in a separate PR
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
closing for time being, won't delete the branch so we can come back to it later |
It's the PR ready for review? If yes then it's good to keep it open and call for reviews . I can do review if it's ready |
Description
Adds
Update
,Delete
andWrite
methods toIterator
to allow batching updates and deletes while iterating. Updates and Deletes get applied after iteration is done usingWrite
.Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change