summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/asyncio/session.py
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2022-01-19 22:10:09 +0100
committerMike Bayer <mike_mp@zzzcomputing.com>2022-01-19 17:23:53 -0500
commite5606c0ba8bf2fed6daa7a488433d55ddbf302e9 (patch)
treec6cee53e939560f9081099e4465d855f25ca73de /lib/sqlalchemy/ext/asyncio/session.py
parentb235a8cb1042cb7706dddc0f783cabb81e141055 (diff)
downloadsqlalchemy-e5606c0ba8bf2fed6daa7a488433d55ddbf302e9.tar.gz
Added missing method ``invalidate` in the `AsyncSession`
Fixes: #7524 Change-Id: I20387e6700015c44f23bd2d05347bdce802196c0
Diffstat (limited to 'lib/sqlalchemy/ext/asyncio/session.py')
-rw-r--r--lib/sqlalchemy/ext/asyncio/session.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sqlalchemy/ext/asyncio/session.py b/lib/sqlalchemy/ext/asyncio/session.py
index bb074400a..0840a0d7d 100644
--- a/lib/sqlalchemy/ext/asyncio/session.py
+++ b/lib/sqlalchemy/ext/asyncio/session.py
@@ -605,6 +605,13 @@ class AsyncSession(ReversibleProxy):
"""
return await greenlet_spawn(self.sync_session.close)
+ async def invalidate(self):
+ """Close this Session, using connection invalidation.
+
+ For a complete description, see :meth:`_orm.Session.invalidate`.
+ """
+ return await greenlet_spawn(self.sync_session.invalidate)
+
@classmethod
async def close_all(self):
"""Close all :class:`_asyncio.AsyncSession` sessions."""