diff options
Diffstat (limited to 'lib/sqlalchemy/ext/asyncio/session.py')
-rw-r--r-- | lib/sqlalchemy/ext/asyncio/session.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/sqlalchemy/ext/asyncio/session.py b/lib/sqlalchemy/ext/asyncio/session.py index a62c7177c..6b18e3d7c 100644 --- a/lib/sqlalchemy/ext/asyncio/session.py +++ b/lib/sqlalchemy/ext/asyncio/session.py @@ -330,13 +330,18 @@ class AsyncSession(ReversibleProxy): else: return None - async def connection(self): + async def connection(self, **kw): r"""Return a :class:`_asyncio.AsyncConnection` object corresponding to this :class:`.Session` object's transactional state. + .. versionadded:: 1.4.24 Added **kw arguments which are passed through + to the underlying :meth:`_orm.Session.connection` method. + """ - sync_connection = await greenlet_spawn(self.sync_session.connection) + sync_connection = await greenlet_spawn( + self.sync_session.connection, **kw + ) return engine.AsyncConnection._retrieve_proxy_for_target( sync_connection ) |