Move bind parameters to the right-hand side of an operator, where possible.
(self, binary, **kwargs)
| 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 |