]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
add session-wide execution_options
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 26 Aug 2025 20:54:39 +0000 (16:54 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 31 Aug 2025 13:53:02 +0000 (09:53 -0400)
commit27c0dafbeb26e6317663629cc61dd6fe2afb4d2a
treebcbf4bd2f5767e08f619b84b2c60ca2bf43be9fc
parentb939befa507b9f400dcee3d7285547a178d6b088
add session-wide execution_options

Added support for per-session execution options that are merged into all
queries executed within that session. The :class:`_orm.Session`,
:class:`_orm.sessionmaker`, :class:`_orm.scoped_session`,
:class:`_ext.asyncio.AsyncSession`, and
:class:`_ext.asyncio.async_sessionmaker` constructors now accept an
:paramref:`_orm.Session.execution_options` parameter that will be applied
to all explicit query executions (e.g. using :meth:`_orm.Session.execute`,
:meth:`_orm.Session.get`, :meth:`_orm.Session.scalars`) for that session
instance.

Fixes: #12659
Change-Id: I6e19e1567e0c04df32ba1d43baf420fb762f155c
doc/build/changelog/unreleased_21/12659.rst [new file with mode: 0644]
lib/sqlalchemy/ext/asyncio/scoping.py
lib/sqlalchemy/ext/asyncio/session.py
lib/sqlalchemy/orm/scoping.py
lib/sqlalchemy/orm/session.py
test/ext/asyncio/test_session_py3k.py
test/orm/test_session.py
tools/generate_proxy_methods.py