-
Notifications
You must be signed in to change notification settings - Fork 32
feat: support request and transaction tags #558
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
Conversation
Adds support for setting transaction tags and request tags in dbapi. This makes these options available to frameworks that depend on dbapi, like SQLAlchemy and Django. Towards #525
Thanks for your support! BTW, this
|
You can set execution_options on a lower level than the engine. E.g. it can also be set for specific queries like this: with Session(engine.execution_options(read_only=True)) as session:
# Execute two queries in a read-only transaction.
session.scalars(
select(Singer).execution_options(request_tag="my-tag-1")
).all()
session.scalars(
select(Singer).execution_options(request_tag="my-tag-2")
).all() The request tag is then set on the request_tag = self.execution_options.get("request_tag")
if request_tag:
self.cursor.request_tag = request_tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
Do not merge: Depends on googleapis/python-spanner#1262
Fixes #525