-
Notifications
You must be signed in to change notification settings - Fork 134
feat(inserter): add callback function support #307
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
Conversation
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.
A couple of nits, otherwise looks fine.
rename with_on_commit > with_commit_callback
@abonander addressed the comments (P.S. I merged instead of a rebasing because I can see from the commit history that this PR will be squashed and merged) |
There are some failures with rustfmt and clippy; otherwise, it looks good |
addressed most of them. suppressed one as per - #307 (comment) |
@abonander, please review when you get the chance |
bump on this |
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.
This looks good to me, but it's an open question whether we want to block this on adding a test.
I'm personally on the fence about it since the added functionality is rather trivial, so as long as inserts continue to function correctly (which is covered already) it doesn't seem like it needs a specific test.
But I'd like @slvrtrn's opinion on it before merging.
Let's add more tests as a follow-up. |
Co-authored-by: Serge Klochkov <[email protected]> Co-authored-by: Austin Bonander <[email protected]>
Summary
Adds
with_on_commit
to the clickhouse inserter to hook a function call after a batch is actually committed (for e.g. bumping an OTEL metric tracking number of rows written to the database)Addresses #306