]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
establish sessionmaker and async_sessionmaker as generic
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 26 May 2022 18:35:03 +0000 (14:35 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 31 May 2022 19:17:48 +0000 (15:17 -0400)
commitd24cd5e96d7f8e47c86b5013a7f989a15e2eec89
tree4291dbaeea6b78164e492da183cff5e8e7dfd9d6
parent5531cec630ee75bfd7f5848cfe622c769be5ae48
establish sessionmaker and async_sessionmaker as generic

This is so that custom Session and AsyncSession classes
can be typed for these factories.  Added appropriate
typevars to  `__call__()`, `__enter__()` and other methods
so that a custom Session or AsyncSession subclass is carried
through.

Fixes: #7656
Change-Id: Ia2b8c1f22b4410db26005c3285f6ba3d13d7f0e0
examples/asyncio/gather_orm_statements.py
lib/sqlalchemy/ext/asyncio/engine.py
lib/sqlalchemy/ext/asyncio/scoping.py
lib/sqlalchemy/ext/asyncio/session.py
lib/sqlalchemy/orm/scoping.py
lib/sqlalchemy/orm/session.py
test/ext/mypy/plain_files/sessionmakers.py [new file with mode: 0644]