]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Remove compare_against_backend
authorFederico Caselli <cfederico87@gmail.com>
Wed, 18 Oct 2023 17:51:00 +0000 (19:51 +0200)
committerFederico Caselli <cfederico87@gmail.com>
Wed, 18 Oct 2023 17:51:34 +0000 (19:51 +0200)
Removed unused placeholder method :meth:`.TypeEngine.compare_against_backend`
This method was used by very old versions of Alembic.
See https://github.com/sqlalchemy/alembic/issues/1293 for details.
Follow up of alembic change I6f480711ec94cd4113d3f0ca114d143b49b8d869

Change-Id: I48ba2b26128ba6f74cb0b2c54caa6f7d2a711257

doc/build/changelog/unreleased_20/compare_against_backend.rst [new file with mode: 0644]
lib/sqlalchemy/sql/type_api.py

diff --git a/doc/build/changelog/unreleased_20/compare_against_backend.rst b/doc/build/changelog/unreleased_20/compare_against_backend.rst
new file mode 100644 (file)
index 0000000..59291e5
--- /dev/null
@@ -0,0 +1,6 @@
+.. change::
+    :tags: sql
+
+    Removed unused placeholder method :meth:`.TypeEngine.compare_against_backend`
+    This method was used by very old versions of Alembic.
+    See https://github.com/sqlalchemy/alembic/issues/1293 for details.
index f839cf57d82801eb585af3aef4efeb3b667e67f5..9cf4872d023bbcee3510c8b0a0a873cfcfdfac58 100644 (file)
@@ -354,33 +354,6 @@ class TypeEngine(Visitable, Generic[_T]):
     def copy(self, **kw: Any) -> Self:
         return self.adapt(self.__class__)
 
-    def compare_against_backend(
-        self, dialect: Dialect, conn_type: TypeEngine[Any]
-    ) -> Optional[bool]:
-        """Compare this type against the given backend type.
-
-        This function is currently not implemented for SQLAlchemy
-        types, and for all built in types will return ``None``.  However,
-        it can be implemented by a user-defined type
-        where it can be consumed by schema comparison tools such as
-        Alembic autogenerate.
-
-        A future release of SQLAlchemy will potentially implement this method
-        for builtin types as well.
-
-        The function should return True if this type is equivalent to the
-        given type; the type is typically reflected from the database
-        so should be database specific.  The dialect in use is also
-        passed.   It can also return False to assert that the type is
-        not equivalent.
-
-        :param dialect: a :class:`.Dialect` that is involved in the comparison.
-
-        :param conn_type: the type object reflected from the backend.
-
-        """
-        return None
-
     def copy_value(self, value: Any) -> Any:
         return value