]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
use a heuristic for pure "future engine" until future engine merges
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 5 Nov 2021 16:19:12 +0000 (12:19 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 5 Nov 2021 16:19:12 +0000 (12:19 -0400)
Change-Id: I0d5605091c3010ce50bcd0083dfb3c9615212d22

alembic/util/sqla_compat.py

index a05e27bc6c1b5f2c640fb08c1234772f9517e985..57a6a769dcbcbbfe0ff4f4e86008122850f5261e 100644 (file)
@@ -58,7 +58,15 @@ _vers = tuple(
 sqla_13 = _vers >= (1, 3)
 sqla_14 = _vers >= (1, 4)
 sqla_14_26 = _vers >= (1, 4, 26)
-sqla_1x = _vers < (2,)
+
+
+if sqla_14:
+    # when future engine merges, this can be again based on version string
+    from sqlalchemy.engine import Connection as legacy_connection
+
+    sqla_1x = not hasattr(legacy_connection, "commit")
+else:
+    sqla_1x = True
 
 try:
     from sqlalchemy import Computed  # noqa