summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/asyncio
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/ext/asyncio')
-rw-r--r--lib/sqlalchemy/ext/asyncio/scoping.py1
-rw-r--r--lib/sqlalchemy/ext/asyncio/session.py7
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/sqlalchemy/ext/asyncio/scoping.py b/lib/sqlalchemy/ext/asyncio/scoping.py
index 535c30d61..46c8f0baa 100644
--- a/lib/sqlalchemy/ext/asyncio/scoping.py
+++ b/lib/sqlalchemy/ext/asyncio/scoping.py
@@ -36,6 +36,7 @@ from ...util import ScopedRegistry
"get",
"get_bind",
"is_modified",
+ "invalidate",
"merge",
"refresh",
"rollback",
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."""