]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Allow custom sync session class in ``AsyncSession``.
authorFederico Caselli <cfederico87@gmail.com>
Fri, 27 Aug 2021 20:45:56 +0000 (22:45 +0200)
committermike bayer <mike_mp@zzzcomputing.com>
Mon, 30 Aug 2021 14:52:37 +0000 (14:52 +0000)
commitaf0824fd790bad28beb01c11f262ac1ffe8c53be
tree0b3dac30ce93d7b3bcf64579f944ed676522806f
parent9131a5208f28ea3c2991c2b05873a495c1a9c851
Allow custom sync session class in ``AsyncSession``.

The :class:`_asyncio.AsyncSession` now supports overriding which
:class:`_orm.Session` it uses as the proxied instance. A custom ``Session``
class can be passed using the :paramref:`.AsyncSession.sync_session_class`
parameter or by subclassing the ``AsyncSession`` and specifying a custom
:attr:`.AsyncSession.sync_session_class`.

Fixes: #6689
Change-Id: Idf9c24eae6c9f4e2fff292ed748feaa449a8deaa
doc/build/changelog/unreleased_14/6689.rst [new file with mode: 0644]
doc/build/orm/extensions/asyncio.rst
lib/sqlalchemy/ext/asyncio/session.py
test/ext/asyncio/test_session_py3k.py