Skip to content
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: add method for getting batched statements #318

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

olavloite
Copy link
Collaborator

Adds a GetBatchedStatements function that returns the currently buffered statements that will be executed if RunBatch is called. This gives applications the possibility of inspecting the list of buffered statements before actually executing them.

@olavloite olavloite requested a review from a team as a code owner November 14, 2024 11:43
Adds a GetBatchedStatements function that returns the currently
buffered statements that will be executed if RunBatch is called.
This gives applications the possibility of inspecting the list of
buffered statements before actually executing them.
@olavloite olavloite force-pushed the add-get-batched-statements branch from f2737e3 to 5130edd Compare November 14, 2024 11:47
@olavloite olavloite requested a review from rahul2393 November 14, 2024 11:47
driver.go Outdated
}
res := make([]spanner.Statement, len(c.batch.statements))
copy(res, c.batch.statements)
return res
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip: you can use return slices.Clone(c.batch.statements) for slightly shorter code.

@olavloite olavloite merged commit 03d4818 into main Nov 14, 2024
16 checks passed
@olavloite olavloite deleted the add-get-batched-statements branch November 14, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants