Uh oh!
There was an error while loading. Please reload this page.
feat: support request and transaction tags - #558
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
ahr9n
commented
Dec 19, 2024
Thanks for your support! BTW, this
|
olavloite
commented
Jan 6, 2025
You can set execution_options on a lower level than the engine. E.g. it can also be set for specific queries like this: withSession(engine.execution_options(read_only=True)) assession:
# 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")
ifrequest_tag:
self.cursor.request_tag=request_tag |
Do not merge: Depends on googleapis/python-spanner#1262
Fixes#525