]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
add OperatorClasses to gate mismatched operator use
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 16 Jul 2025 16:14:27 +0000 (12:14 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 25 Aug 2025 20:47:24 +0000 (16:47 -0400)
commit34740d33abffc8e5ec11dd1f2ed98bf42ea078f6
tree1981e00edfa7de1d83f48d4a0aa2ead5933dc529
parentb939befa507b9f400dcee3d7285547a178d6b088
add OperatorClasses to gate mismatched operator use

Added a new concept of "operator classes" to the SQL operators supported by
SQLAlchemy, represented within the enum :class:`.OperatorClass`.  The
purpose of this structure is to provide an extra layer of validation when a
particular kind of SQL operation is used with a particular datatype, to
catch early the use of an operator that does not have any relevance to the
datatype in use; a simple example is an integer or numeric column used with
a "string match" operator.

Fixes: #12736
Change-Id: I44f46d7326aef6847dbf0cf7a325833f8e347da6
27 files changed:
doc/build/changelog/migration_21.rst
doc/build/changelog/unreleased_21/12736.rst [new file with mode: 0644]
doc/build/core/operators.rst
doc/build/core/sqlelement.rst
lib/sqlalchemy/dialects/oracle/types.py
lib/sqlalchemy/dialects/postgresql/hstore.py
lib/sqlalchemy/dialects/postgresql/json.py
lib/sqlalchemy/dialects/postgresql/ranges.py
lib/sqlalchemy/dialects/postgresql/types.py
lib/sqlalchemy/sql/default_comparator.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/expression.py
lib/sqlalchemy/sql/operators.py
lib/sqlalchemy/sql/sqltypes.py
lib/sqlalchemy/sql/type_api.py
lib/sqlalchemy/types.py
test/dialect/mysql/test_compiler.py
test/dialect/oracle/test_compiler.py
test/dialect/postgresql/test_compiler.py
test/dialect/postgresql/test_types.py
test/dialect/test_sqlite.py
test/ext/test_hybrid.py
test/orm/dml/test_evaluator.py
test/orm/test_query.py
test/sql/test_lambdas.py
test/sql/test_operators.py
test/sql/test_types.py