Skip to content

feat(spanner): support the last_statement flag#5920

Open
olavloite wants to merge 2 commits into
googleapis:mainfrom
olavloite:spanner-last-statement
Open

feat(spanner): support the last_statement flag#5920
olavloite wants to merge 2 commits into
googleapis:mainfrom
olavloite:spanner-last-statement

Conversation

@olavloite

Copy link
Copy Markdown
Contributor

Spanner allows an application to indicate when a statement will be the last statement in a read/write transaction. Spanner can use this flag to optimize the execution of the last statement, as it means that Spanner can safely defer some of the internal verifications until the Commit call for the transaction.

Spanner allows an application to indicate when a statement will be the last statement
in a read/write transaction. Spanner can use this flag to optimize the execution of
the last statement, as it means that Spanner can safely defer some of the internal
verifications until the Commit call for the transaction.
@olavloite olavloite requested review from a team as code owners June 21, 2026 06:25
@product-auto-label product-auto-label Bot added the api: spanner Issues related to the Spanner API. label Jun 21, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for indicating whether a statement or a batch of DML statements is the last one in a read/write transaction, enabling Spanner to optimize execution. It introduces last_statement to Statement and StatementBuilder, and last_statements to BatchDml and BatchDmlBuilder, along with associated unit and integration tests. As there are no review comments, I have no additional feedback to provide.

@codecov

codecov Bot commented Jun 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.90%. Comparing base (92dded3) to head (c4ee40f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5920   +/-   ##
=======================================
  Coverage   97.89%   97.90%           
=======================================
  Files         234      234           
  Lines       59904    59977   +73     
=======================================
+ Hits        58644    58719   +75     
+ Misses       1260     1258    -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@olavloite olavloite requested a review from sakthivelmanii June 21, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the Spanner API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants