MCPcopy Index your code
hub / github.com/sqlalchemy/sqlalchemy / _generate_generic_binary

Method _generate_generic_binary

lib/sqlalchemy/sql/compiler.py:3662–3685  ·  view source on GitHub ↗
(
        self,
        binary: BinaryExpression[Any],
        opstring: str,
        eager_grouping: bool = False,
        **kw: Any,
    )

Source from the content-addressed store, hash-verified

3660 )
3661
3662 def _generate_generic_binary(
3663 self,
3664 binary: BinaryExpression[Any],
3665 opstring: str,
3666 eager_grouping: bool = False,
3667 **kw: Any,
3668 ) -> str:
3669 _in_operator_expression = kw.get("_in_operator_expression", False)
3670
3671 kw["_in_operator_expression"] = True
3672 kw["_binary_op"] = binary.operator
3673 text = (
3674 binary.left._compiler_dispatch(
3675 self, eager_grouping=eager_grouping, **kw
3676 )
3677 + opstring
3678 + binary.right._compiler_dispatch(
3679 self, eager_grouping=eager_grouping, **kw
3680 )
3681 )
3682
3683 if _in_operator_expression and eager_grouping:
3684 text = "(%s)" % text
3685 return text
3686
3687 def _generate_generic_unary_operator(self, unary, opstring, **kw):
3688 return opstring + unary.element._compiler_dispatch(self, **kw)

Calls 2

getMethod · 0.45
_compiler_dispatchMethod · 0.45