]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add AdaptedConnection.run_async
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 19 Jan 2022 19:31:52 +0000 (14:31 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 19 Jan 2022 20:48:28 +0000 (15:48 -0500)
commit09ad975505adb2118f229cb5b1a75c2c412420ae
treef3afd0c2bce1730f54481ba4bde87eda22d5b6b9
parente6ded82eef63235d7cbfe3ab3382a48f32913640
Add AdaptedConnection.run_async

Added new method :meth:`.AdaptedConnection.run_async` to the DBAPI
connection interface used by asyncio drivers, which allows methods to be
called against the underlying "driver" connection directly within a
sync-style function where the ``await`` keyword can't be used, such as
within SQLAlchemy event handler functions. The method is analogous to the
:meth:`_asyncio.AsyncConnection.run_sync` method which translates
async-style calls to sync-style. The method is useful for things like
connection-pool on-connect handlers that need to invoke awaitable methods
on the driver connection when it's first created.

Fixes: #7580
Change-Id: I03c98a72bda0234deb19c00095b31a36f19bf36d
doc/build/changelog/unreleased_14/7580.rst [new file with mode: 0644]
doc/build/orm/extensions/asyncio.rst
lib/sqlalchemy/engine/interfaces.py
test/ext/asyncio/test_engine_py3k.py