Skip to content

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.

4 participants