-
Notifications
You must be signed in to change notification settings - Fork 637
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: discard batch safely after commit batch #217
Conversation
add ut for discard. |
I think this is a little complicated, like we have to maintain the A better simple solution is to add a
so the user will either call commit or rollback. |
done, review. |
I think the |
examples/batch/main.go
Outdated
@@ -20,6 +22,7 @@ func main() { | |||
|
|||
// create a batch | |||
batch := db.NewBatch(rosedb.DefaultBatchOptions) | |||
defer batch.Rollback() |
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.
use will either call Commit
or Rollback
, so need to call this in defer
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.
done
change
refer: