Skip to content

feat(spanner): add BatchWrite transaction#5502

Open
olavloite wants to merge 3 commits intogoogleapis:mainfrom
olavloite:spanner-batch-write-step-2
Open

feat(spanner): add BatchWrite transaction#5502
olavloite wants to merge 3 commits intogoogleapis:mainfrom
olavloite:spanner-batch-write-step-2

Conversation

@olavloite
Copy link
Copy Markdown
Contributor

Adds support for BatchWrite transactions. BatchWrite can be used to write
large numbers of mutations to Spanner. A BatchWrite transaction is not
guaranteed to be atomic. However, each MutationGroup in a BatchWrite
transaction is guaranteed to be atomic.

This change adds a method that returns a stream of responses and delegates
all error handling to the application. A follow-up pull request will add a
managed execution method that handles errors automatically.

Depends on #5499

Adds the foundations for batch write transactions. The public API will be
added in a follow-up pull request.
@olavloite olavloite requested review from a team as code owners April 22, 2026 16:04
@product-auto-label product-auto-label Bot added the api: spanner Issues related to the Spanner API. label Apr 22, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

❌ Patch coverage is 98.58156% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.74%. Comparing base (902a7cb) to head (e79d1e7).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/spanner/src/batch_write_transaction.rs 97.67% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #5502    +/-   ##
========================================
  Coverage   97.74%   97.74%            
========================================
  Files         218      219     +1     
  Lines       48288    48429   +141     
========================================
+ Hits        47198    47336   +138     
- Misses       1090     1093     +3     

☔ View full report in Codecov by Sentry.
📢 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.

Adds support for BatchWrite transactions. BatchWrite can be used to write
large numbers of mutations to Spanner. A BatchWrite transaction is not
guaranteed to be atomic. However, each MutationGroup in a BatchWrite
transaction is guaranteed to be atomic.

This change adds a method that returns a stream of responses and delegates
all error handling to the application. A follow-up pull request will add a
managed execution method that handles errors automatically.
@olavloite olavloite force-pushed the spanner-batch-write-step-2 branch from f757e38 to e79d1e7 Compare April 22, 2026 16:25
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.

1 participant