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 SQL statement for begin transaction isolation level #1331

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

olavloite
Copy link
Contributor

Adds an additional option to the begin [transaction] SQL statement to specify the isolation level of that transaction. The following format is now supported:

{begin | start} [transaction] [isolation level {repeatable read | serializable}]

@olavloite olavloite requested review from a team as code owners April 3, 2025 11:52
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Apr 3, 2025
@olavloite olavloite requested a review from aakashanandg April 3, 2025 11:53
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/python-spanner API. label Apr 3, 2025
Adds an additional option to the `begin [transaction]` SQL statement to
specify the isolation level of that transaction. The following format is
now supported:

```
{begin | start} [transaction] [isolation level {repeatable read | serializable}]
```
@olavloite olavloite force-pushed the dbapi-begin-isolation-level branch from f15b60a to 56fe1a5 Compare April 3, 2025 12:16
@@ -117,3 +117,27 @@ def test_transaction_isolation_level(self):
self.assertEqual(1, len(begin_requests))
self.assertEqual(begin_requests[0].options.isolation_level, level)
MockServerTestBase.spanner_service.clear_requests()

Copy link
Contributor

@aakashanandg aakashanandg Apr 7, 2025

Choose a reason for hiding this comment

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

nit: Should we also include a negative test case for invalid isolation level types? Just to verify the user experience.

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 googleapis/python-spanner API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants