diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2020-10-30 15:14:18 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2020-10-30 15:14:18 +0000 |
commit | 841eb216644202567ebddfc0badc51a3a35e98c3 (patch) | |
tree | 40f930139e5a5fb707c3c3090bd2aabb455dd9cb /lib/sqlalchemy/sql/compiler.py | |
parent | 163a97c6d57db09d6405124dae9b877bc9629721 (diff) | |
parent | 9ddbd585a62ff1ad56e9ee6fef5898ced1932a88 (diff) | |
download | sqlalchemy-841eb216644202567ebddfc0badc51a3a35e98c3.tar.gz |
Merge "Apply underscore naming to several more operators"
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 10499975c..23c9d5c0a 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -185,10 +185,10 @@ OPERATORS = { operators.ge: " >= ", operators.eq: " = ", operators.is_distinct_from: " IS DISTINCT FROM ", - operators.isnot_distinct_from: " IS NOT DISTINCT FROM ", + operators.is_not_distinct_from: " IS NOT DISTINCT FROM ", operators.concat_op: " || ", operators.match_op: " MATCH ", - operators.notmatch_op: " NOT MATCH ", + operators.not_match_op: " NOT MATCH ", operators.in_op: " IN ", operators.not_in_op: " NOT IN ", operators.comma_op: ", ", @@ -206,8 +206,8 @@ OPERATORS = { # modifiers operators.desc_op: " DESC", operators.asc_op: " ASC", - operators.nullsfirst_op: " NULLS FIRST", - operators.nullslast_op: " NULLS LAST", + operators.nulls_first_op: " NULLS FIRST", + operators.nulls_last_op: " NULLS LAST", } FUNCTIONS = { @@ -1860,7 +1860,7 @@ class SQLCompiler(Compiled): "Unary expression has no operator or modifier" ) - def visit_istrue_unary_operator(self, element, operator, **kw): + def visit_is_true_unary_operator(self, element, operator, **kw): if ( element._is_implicitly_boolean or self.dialect.supports_native_boolean @@ -1869,7 +1869,7 @@ class SQLCompiler(Compiled): else: return "%s = 1" % self.process(element.element, **kw) - def visit_isfalse_unary_operator(self, element, operator, **kw): + def visit_is_false_unary_operator(self, element, operator, **kw): if ( element._is_implicitly_boolean or self.dialect.supports_native_boolean @@ -1878,7 +1878,7 @@ class SQLCompiler(Compiled): else: return "%s = 0" % self.process(element.element, **kw) - def visit_notmatch_op_binary(self, binary, operator, **kw): + def visit_not_match_op_binary(self, binary, operator, **kw): return "NOT %s" % self.visit_binary( binary, override_operator=operators.match_op ) @@ -2083,11 +2083,11 @@ class SQLCompiler(Compiled): binary.right = percent.__add__(binary.right).__add__(percent) return self.visit_like_op_binary(binary, operator, **kw) - def visit_notcontains_op_binary(self, binary, operator, **kw): + def visit_not_contains_op_binary(self, binary, operator, **kw): binary = binary._clone() percent = self._like_percent_literal binary.right = percent.__add__(binary.right).__add__(percent) - return self.visit_notlike_op_binary(binary, operator, **kw) + return self.visit_not_like_op_binary(binary, operator, **kw) def visit_startswith_op_binary(self, binary, operator, **kw): binary = binary._clone() @@ -2095,11 +2095,11 @@ class SQLCompiler(Compiled): binary.right = percent.__radd__(binary.right) return self.visit_like_op_binary(binary, operator, **kw) - def visit_notstartswith_op_binary(self, binary, operator, **kw): + def visit_not_startswith_op_binary(self, binary, operator, **kw): binary = binary._clone() percent = self._like_percent_literal binary.right = percent.__radd__(binary.right) - return self.visit_notlike_op_binary(binary, operator, **kw) + return self.visit_not_like_op_binary(binary, operator, **kw) def visit_endswith_op_binary(self, binary, operator, **kw): binary = binary._clone() @@ -2107,11 +2107,11 @@ class SQLCompiler(Compiled): binary.right = percent.__add__(binary.right) return self.visit_like_op_binary(binary, operator, **kw) - def visit_notendswith_op_binary(self, binary, operator, **kw): + def visit_not_endswith_op_binary(self, binary, operator, **kw): binary = binary._clone() percent = self._like_percent_literal binary.right = percent.__add__(binary.right) - return self.visit_notlike_op_binary(binary, operator, **kw) + return self.visit_not_like_op_binary(binary, operator, **kw) def visit_like_op_binary(self, binary, operator, **kw): escape = binary.modifiers.get("escape", None) @@ -2126,7 +2126,7 @@ class SQLCompiler(Compiled): else "" ) - def visit_notlike_op_binary(self, binary, operator, **kw): + def visit_not_like_op_binary(self, binary, operator, **kw): escape = binary.modifiers.get("escape", None) return "%s NOT LIKE %s" % ( binary.left._compiler_dispatch(self, **kw), @@ -2148,7 +2148,7 @@ class SQLCompiler(Compiled): else "" ) - def visit_notilike_op_binary(self, binary, operator, **kw): + def visit_not_ilike_op_binary(self, binary, operator, **kw): escape = binary.modifiers.get("escape", None) return "lower(%s) NOT LIKE lower(%s)" % ( binary.left._compiler_dispatch(self, **kw), @@ -2165,7 +2165,7 @@ class SQLCompiler(Compiled): binary, " BETWEEN SYMMETRIC " if symmetric else " BETWEEN ", **kw ) - def visit_notbetween_op_binary(self, binary, operator, **kw): + def visit_not_between_op_binary(self, binary, operator, **kw): symmetric = binary.modifiers.get("symmetric", False) return self._generate_generic_binary( binary, |