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: Exposing Spanner client in dbapi connection #1100

Merged
merged 3 commits into from
Feb 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next Next commit
feat: Exposing Spanner client in dbapi connection
  • Loading branch information
ankiaga committed Feb 9, 2024
commit 17aff66fe4e367ff4f2aa87c91381719ee2ee104
7 changes: 7 additions & 0 deletions google/cloud/spanner_dbapi/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ def __init__(self, instance, database=None, read_only=False):
self._batch_dml_executor: BatchDmlExecutor = None
self._transaction_helper = TransactionRetryHelper(self)

@property
def spanner_client(self):
"""Client for interacting with Cloud Spanner API. This property exposes
the spanner client so that underlying methods could be accessed.
ankiaga marked this conversation as resolved.
Show resolved Hide resolved
"""
return self._instance._client

@property
def autocommit(self):
"""Autocommit mode flag for this connection.
Expand Down