From: DanCardin Date: Tue, 21 Dec 2021 19:07:23 +0000 (-0500) Subject: docs: Add missing engine.dispose() call to the asyncio cookbook example. (#973) X-Git-Tag: rel_1_7_6~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1740bcbc16ccbbe557e02e85b12d6629c218ad53;p=thirdparty%2Fsqlalchemy%2Falembic.git docs: Add missing engine.dispose() call to the asyncio cookbook example. (#973) --- diff --git a/alembic/templates/async/env.py b/alembic/templates/async/env.py index ade3dc40..4ac2b6ac 100644 --- a/alembic/templates/async/env.py +++ b/alembic/templates/async/env.py @@ -77,6 +77,8 @@ async def run_migrations_online(): async with connectable.connect() as connection: await connection.run_sync(do_run_migrations) + await connectable.dispose() + if context.is_offline_mode(): run_migrations_offline() diff --git a/docs/build/cookbook.rst b/docs/build/cookbook.rst index 68775801..e464cc8b 100644 --- a/docs/build/cookbook.rst +++ b/docs/build/cookbook.rst @@ -1485,6 +1485,8 @@ file that's used by Alembic to start its operations. In particular only async with connectable.connect() as connection: await connection.run_sync(do_run_migrations) + await connectable.dispose() + if context.is_offline_mode(): run_migrations_offline()