diff options
| author | Federico Caselli <cfederico87@gmail.com> | 2021-08-27 22:45:56 +0200 |
|---|---|---|
| committer | mike bayer <mike_mp@zzzcomputing.com> | 2021-08-30 14:52:37 +0000 |
| commit | af0824fd790bad28beb01c11f262ac1ffe8c53be (patch) | |
| tree | 0b3dac30ce93d7b3bcf64579f944ed676522806f /doc | |
| parent | 9131a5208f28ea3c2991c2b05873a495c1a9c851 (diff) | |
| download | sqlalchemy-af0824fd790bad28beb01c11f262ac1ffe8c53be.tar.gz | |
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
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/build/changelog/unreleased_14/6689.rst | 9 | ||||
| -rw-r--r-- | doc/build/orm/extensions/asyncio.rst | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/doc/build/changelog/unreleased_14/6689.rst b/doc/build/changelog/unreleased_14/6689.rst new file mode 100644 index 000000000..6abebc5f3 --- /dev/null +++ b/doc/build/changelog/unreleased_14/6689.rst @@ -0,0 +1,9 @@ +.. change:: + :tags: asyncio, usecase + :tickets: 6746 + + 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`. diff --git a/doc/build/orm/extensions/asyncio.rst b/doc/build/orm/extensions/asyncio.rst index c5fc356d1..940c19a7e 100644 --- a/doc/build/orm/extensions/asyncio.rst +++ b/doc/build/orm/extensions/asyncio.rst @@ -581,6 +581,9 @@ ORM Session API Documentation .. autoclass:: AsyncSession :members: + :exclude-members: sync_session_class + + .. autoattribute:: sync_session_class .. autoclass:: AsyncSessionTransaction :members: |
