MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / visit_binary

Method visit_binary

lib/sqlalchemy/dialects/mssql/base.py:2325–2341  ·  view source on GitHub ↗

Move bind parameters to the right-hand side of an operator, where possible.

(self, binary, **kwargs)

Source from the content-addressed store, hash-verified

2323 )
2324
2325 def visit_binary(self, binary, **kwargs):
2326 """Move bind parameters to the right-hand side of an operator, where
2327 possible.
2328
2329 """
2330 if (
2331 isinstance(binary.left, expression.BindParameter)
2332 and binary.operator == operator.eq
2333 and not isinstance(binary.right, expression.BindParameter)
2334 ):
2335 return self.process(
2336 expression.BinaryExpression(
2337 binary.right, binary.left, binary.operator
2338 ),
2339 **kwargs,
2340 )
2341 return super().visit_binary(binary, **kwargs)
2342
2343 def returning_clause(
2344 self, stmt, returning_cols, *, populate_result_map, **kw

Callers

nothing calls this directly

Calls 1

processMethod · 0.45

Tested by

no test coverage detected