feat(csharp): implement transaction support#217
Merged
CurtHagenlocher merged 2 commits intoJun 17, 2026
Conversation
Add BigQuery session-based transaction support to the C# ADBC driver, matching the existing Go implementation pattern: - BigQueryConnection: Add AutoCommit property override that creates/closes BigQuery sessions, and Commit/Rollback methods that issue COMMIT/ROLLBACK TRANSACTION and immediately BEGIN a new transaction - BigQueryStatement: Pass session_id via ConnectionProperties in QueryOptions when a transaction is active, for both ExecuteQuery and ExecuteUpdate - Tracing: Add session_id tags and lifecycle events (session_created, session_closed, transaction_started, transaction_committed, transaction_rolled_back) to all transaction operations and session-aware query execution via DiagnosticSource Activity tracing - BigQueryMockServer: Add session tracking, parse CreateSession and ConnectionProperties from job requests, return SessionInfo in job stats - TransactionTests: 11 mock server tests covering the full transaction lifecycle (enable/disable autocommit, commit, rollback, error cases, dispose) - TransactionLiveTests: 5 live integration tests (skipped without credentials) covering commit persistence, rollback discard, multiple commits, and error cases against a real BigQuery instance Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds BigQuery session-based transaction support to the C# ADBC driver (aligning with the Go driver’s approach), including session lifecycle management, session-aware query execution, and corresponding mock/live test coverage.
Changes:
- Implement session-backed
AutoCommit,Commit(), andRollback()behavior inBigQueryConnectionusingCreateSession,BEGIN/COMMIT/ROLLBACK TRANSACTION, andBQ.ABORT_SESSION. - Propagate
session_idviaConnectionPropertiesinBigQueryStatementso queries/updates execute within the active transaction session. - Extend the mock server to parse/return session info and add mock + live test suites to validate the transaction lifecycle.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| csharp/src/AdbcDrivers.BigQuery/BigQueryConnection.cs | Implements session creation/teardown and transaction commands behind AutoCommit/Commit/Rollback. |
| csharp/src/AdbcDrivers.BigQuery/BigQueryStatement.cs | Attaches session_id connection properties to query/update jobs when a transaction is active. |
| csharp/test/AdbcDrivers.BigQuery.MockServer/BigQueryMockServer.cs | Adds session parsing/creation and records executed SQL for transaction-related assertions. |
| csharp/test/AdbcDrivers.BigQuery.Tests/MockServer/TransactionTests.cs | Adds mock-server tests covering autocommit toggling and commit/rollback behavior. |
| csharp/test/AdbcDrivers.BigQuery.Tests/TransactionLiveTests.cs | Adds live integration tests validating commit persistence and rollback discard semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
davidhcoe
approved these changes
Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's Changed
Add BigQuery session-based transaction support to the C# ADBC driver, matching the existing Go implementation pattern: