diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-07-09 15:47:14 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-07-09 21:48:39 -0400 |
commit | f7076ecf361f276f5ddb81f80931e5c88215e8ca (patch) | |
tree | f292ec5013c94defbaa4c05cc957cb751e28a412 /lib/sqlalchemy/sql/compiler.py | |
parent | 9d743870722fc6757404674bd821382798a1ba43 (diff) | |
download | sqlalchemy-f7076ecf361f276f5ddb81f80931e5c88215e8ca.tar.gz |
support functions "as binary comparison"
Added new feature :meth:`.FunctionElement.as_comparison` which allows a SQL
function to act as a binary comparison operation that can work within the
ORM.
Change-Id: I07018e2065d09775c0406cabdd35fc38cc0da699
Fixes: #3831
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 75827b34e..ae1dd2c7c 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1079,6 +1079,9 @@ class SQLCompiler(Compiled): else: return self._generate_generic_binary(binary, opstring, **kw) + def visit_function_as_comparison_op_binary(self, element, operator, **kw): + return self.process(element.sql_function, **kw) + def visit_mod_binary(self, binary, operator, **kw): if self.preparer._double_percents: return self.process(binary.left, **kw) + " %% " + \ |