summaryrefslogtreecommitdiff
path: root/alembic/util
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2023-04-29 23:25:21 +0200
committerMike Bayer <mike_mp@zzzcomputing.com>2023-05-12 12:06:14 -0400
commit6d2df6c92c981d220bd1481ebdc7d86274ccf845 (patch)
treebe009a39f769dd4cff23d1fd917f651adeccee72 /alembic/util
parent92e54a0e1c96cecd99397cb1aee9c3bb28f780c6 (diff)
downloadalembic-6d2df6c92c981d220bd1481ebdc7d86274ccf845.tar.gz
Added ``op.run_async``.
Added :meth:`.Operations.run_async` to the operation module to allow running async functions in the ``upgrade`` or ``downgrade`` migration function when running alembic using an async dialect. This function will receive as first argument an class:`~sqlalchemy.ext.asyncio.AsyncConnection` sharing the transaction used in the migration context. also restore the .execute() method to BatchOperations Fixes: #1231 Change-Id: I3c3237d570be3c9bd9834e4c61bb3231bfb82765
Diffstat (limited to 'alembic/util')
-rw-r--r--alembic/util/sqla_compat.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/alembic/util/sqla_compat.py b/alembic/util/sqla_compat.py
index 0070337..37e1ee1 100644
--- a/alembic/util/sqla_compat.py
+++ b/alembic/util/sqla_compat.py
@@ -61,6 +61,8 @@ _vers = tuple(
)
sqla_13 = _vers >= (1, 3)
sqla_14 = _vers >= (1, 4)
+# https://docs.sqlalchemy.org/en/latest/changelog/changelog_14.html#change-0c6e0cc67dfe6fac5164720e57ef307d
+sqla_14_18 = _vers >= (1, 4, 18)
sqla_14_26 = _vers >= (1, 4, 26)
sqla_2 = _vers >= (2,)
sqlalchemy_version = __version__