MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / __init__

Method __init__

lib/sqlalchemy/dialects/mysql/expression.py:80–112  ·  view source on GitHub ↗
(self, *cols: elements.ColumnElement[Any], **kw: Any)

Source from the content-addressed store, hash-verified

78 modifiers: util.immutabledict[str, Any]
79
80 def __init__(self, *cols: elements.ColumnElement[Any], **kw: Any):
81 if not cols:
82 raise exc.ArgumentError("columns are required")
83
84 against = kw.pop("against", None)
85
86 if against is None:
87 raise exc.ArgumentError("against is required")
88 against = coercions.expect(
89 roles.ExpressionElementRole,
90 against,
91 )
92
93 left = elements.BooleanClauseList._construct_raw(
94 operators.comma_op,
95 clauses=cols,
96 )
97 left.group = False
98
99 flags = util.immutabledict(
100 {
101 "mysql_boolean_mode": kw.pop("in_boolean_mode", False),
102 "mysql_natural_language": kw.pop(
103 "in_natural_language_mode", False
104 ),
105 "mysql_query_expansion": kw.pop("with_query_expansion", False),
106 }
107 )
108
109 if kw:
110 raise exc.ArgumentError("unknown arguments: %s" % (", ".join(kw)))
111
112 super().__init__(left, against, operators.match_op, modifiers=flags)
113
114 @_generative
115 def in_boolean_mode(self) -> Self:

Callers

nothing calls this directly

Calls 3

popMethod · 0.45
_construct_rawMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected