Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
operators.cpython-313.pyc1514 linesDownload Raw Back to __pycache__
1�

2��j76���%SrSSKJr SSKJr SSKJr SSKJr	 SSKJ3r SSKJr
 SSKJr SS	KJr SS4KJr SSKJr SSKJr SS
KJr SSKJr SSKJr SSKJr SSKJ r! SSKJ"r# SSKJ$r% SSKJ&r' SSKJ(r) SSKJ*r+ SSKJ,r- SSK.r.SSK.J/r/ SSK.J0r0 SSK.J1r1 SSK.J2r2 SSK.J3r3 SSK.J4r4 SSK.J5r5 SS K.J6r6 SS!K.J7r7 SS"K.J8r8 SS#K.J9r9 SS$K.J:r: SS%K.J;r; S&S'K<J=r= S&S(K<J>r> S&S)K?J@r@ S&S*K?JArA \.Rr(aS+S,KBJCrC S+S-KDJErE S+S.KFJGrG S+S/KHJIrI \:"S0\/S19rJ\:"S2\0S3\/4S19rK"S4S5\A5rL\1"\L\5r\1"\L\	5r\1"\L\5r5\1"\L\
5r\1"\L\5r\1"\L\5r\1"\L\5r\1"\L\5r\1"\L\5r\1"\L\5r\1"\L\5r\1"\L\5r\1"\L\5r\1"\L\!5r \1"\L\#5r"\1"\L\%5r$\1"\L\'5r&\1"\L\)5r(\1"\L\+5r*\1"\L\-5r,"S6S75rM"S8S9\L\3\J5rN"S:S;\M5rO\\"\\ 1rPS<\QS='\\"\\\\1rRS<\QS>'S�S?jrSS�S@jrTS�SAjrU\SS�SBj5rV\S\US�SCj55rW\SS�SDj5rX\SS�SEj5rY\SS�SFj5rZ\9(a\SS�SGj5r[O\Zr[\SS�SHj5r\\9(a\SS�SIj5r]O\\r]\U\SS�SJj55r^\U\SS�SKj55r_\9(a\SS�SLj5r`O\_r`\U\SS�SMj55ra\U\SS�SNj55rb\9(a\SS�SOj5rcO\brc\SS�SPj5rd\SS�SQj5re\U\SS�S�SRjj55rf\U\SS�S�SSjj55rg\9(a
\SS�S�STjj5rhO\grh\U\SS�S�SUjj55ri\U\SS�S�SVjj55rj\9(a
\SS�S�SWjj5rkO\jrk\U\SS�S�SXjj55rl\U\SS�S�SYjj55rm\9(a\SS�S�SZjj5rnO\mrn\U\SS�S[j55ro\U\SS�S\j55rp\9(a\SS�S]j5rqO\prq\SS�S^j5rr\SS�S_j5rs\SS�S`j5rtS�Sajru\U\SS�S�Sbjj55rv\U\SS�S�Scjj55rw\9(a\SS�S�Sdjj5rxO\wrx\U\SS�S�Sejj55ry\U\SS�S�Sfjj55rz\U\SS�S�Sgjj55r{\U\SS�S�Shjj55r|\9(a\SS�S�Sijj5r}O\|r}\U\SS�S�Sjjj55r~\U\SS�S�Skjj55r\U\SS�S�Sljj55r�\U\SS�S�Smjj55r�\9(a\SS�S�Snjj5r�O\�r�\U\SS�S�Sojj55r�\U\SS�S�Spjj55r�\U\SS�Sqj55r�\U\SS�S�Srjj55r�\U\SS�S�Ssjj55r�\SS�S�Stjj5r�\U\SS�Suj55r�\9(a\SS�Svj5r�O\�r�\SS�Swj5r�\SS�Sxj5r�\SS�Syj5r�\SS�Szj5r�\SS�S{j5r�\SS�S|j5r�\9(a\SS�S}j5r�O\�r�\SS�S~j5r�\9(a\SS�Sj5r�O\�r�\SS�S�j5r�\SS�S�j5r�\SS�S�j5r�\SS�S�j5r�\SS�S�j5r�\SS�S�j5r�\SS�S�j5r�\SS�S�j5r�S�S�jr�S�S�jr�S�S�jr�S�S�jr�\\Z\\\\&4r�S�S�jr�\\\\\\\\0r�S�S�jr�\PGRI\�\\&/5GRK\\"/5r�S�S�jr�S�S�jr�\�\�\�\�1r�\�GRI\\�\�/5r�\SS�S�j5r�"S�S�\5r�0\VS�_\WS�_\sS�_\tS�_\S�_\�S�_\�S�_\ S�_\,S�_\S�_\S�_\$S�_\�S�_\S�_\*S�_\�S�_\�S�_0\�S�_\�S�_\�S�_\�S�_\�S�_\�S�_\�S�_\�S�_\�S�_\�S�_\iS�_\jS�_\fS�_\gS�_\oS�_\pS�_\aS�_E0\bS�_\S�_\"S�_\^S�_\_S�_\S�_\S�_\S�_\S�_\lS�_\mS�_\rS�_\S�_\ZS�_\\S�_\S�_\&S&_E\�S�\�S�\�S�\dS�\XS�\YS\�S�0Er�S�\QS�'S�S�jr�g)�z*Defines operators used in SQL expressions.�)�annotations)�IntEnum)�add)�and_)�contains)�eq)�floordiv)�ge)�getitem)�gt)�inv)�le)�lshift)�lt)�mod)�mul)�ne)�neg)�or_)�rshift)�sub)�truedivN)�Any)�Callable)�cast)�Dict)�Generic)�Optional)�overload)�Set)�Tuple)�Type)�
TYPE_CHECKING)�TypeVar)�Union�)�exc)�util)�Literal)�Protocol�)�ColumnExpressionArgument)�6CacheConst)�
ColumnElement)�7TypeEngine�_T)�bound�_FN.c��\rSrSr%SrSrS\S'\S8SSjj5r\S9SSjj5rS10S
S	jjrSr	g)�OperatorType�Bzdescribe an op() function.��str�__name__Nc��g�Nr6��self�left�right�other�kwargss     �^D:\code\apps\devtools\python\user_packages\Python313\site-packages\sqlalchemy/sql/operators.py�__call__�OperatorType.__call__I���!�c��gr:r6r;s     rArBrCR���rEc��gr:r6r;s     rArBrC[s��rEr:�11r=zColumnExpressionArgument[Any]r>�
Optional[Any]r?rr@r�returnzColumnElement[Any]�12r=�	Operatorsr>rJr?rr@rrKrM�13r=rr>rJr?rr@rrKrM)14r8�15__module__�__qualname__�__firstlineno__�__doc__�	__slots__�__annotations__rrB�__static_attributes__r6rErAr4r4Bs���$��I��M�
� $�!�+�!��!��	!�16�!�17�
!��!�� $�������	�18��19�
��� $�������	�20��21�
�rEr4c��\rSrSrSrSrSSjrSSjrS
SjrSSSjjr	SSS	jjr22SS23jr\rSSjr
Srg)rM�za�Base of comparison and logical operators.24 25Implements base methods26:meth:`~sqlalchemy.sql.operators.Operators.operate` and27:meth:`~sqlalchemy.sql.operators.Operators.reverse_operate`, as well as28:meth:`~sqlalchemy.sql.operators.Operators.__and__`,29:meth:`~sqlalchemy.sql.operators.Operators.__or__`,30:meth:`~sqlalchemy.sql.operators.Operators.__invert__`.31 32Usually is used via its most common subclass33:class:`.ColumnOperators`.34 35r6c�.�UR[U5$)a�Implement the ``&`` operator.36 37When used with SQL expressions, results in an38AND operation, equivalent to39:func:`_expression.and_`, that is::40 41    a & b42 43is equivalent to::44 45    from sqlalchemy import and_46 47    and_(a, b)48 49Care should be taken when using ``&`` regarding50operator precedence; the ``&`` operator has the highest precedence.51The operands should be enclosed in parenthesis if they contain52further sub expressions::53 54    (a == 2) & (b == 4)55 56)�operater�r<r?s  rA�__and__�Operators.__and__�s��.�|�|�D�%�(�(rEc�.�UR[U5$)a�Implement the ``|`` operator.57 58When used with SQL expressions, results in an59OR operation, equivalent to60:func:`_expression.or_`, that is::61 62    a | b63 64is equivalent to::65 66    from sqlalchemy import or_67 68    or_(a, b)69 70Care should be taken when using ``|`` regarding71operator precedence; the ``|`` operator has the highest precedence.72The operands should be enclosed in parenthesis if they contain73further sub expressions::74 75    (a == 2) | (b == 4)76 77)rYrrZs  rA�__or__�Operators.__or__�s��.�|�|�C��'�'rEc�,�UR[5$)z�Implement the ``~`` operator.78 79When used with SQL expressions, results in a80NOT operation, equivalent to81:func:`_expression.not_`, that is::82 83    ~a84 85is equivalent to::86 87    from sqlalchemy import not_88 89    not_(a)90 91)rYr
�r<s rA�92__invert__�Operators.__invert__�s�� �|�|�C� � rENc�6^^�[UUUUUS9mSUU4SjjnU$)a!Produce a generic operator function.93 94e.g.::95 96  somecolumn.op("*")(5)97 98produces::99 100  somecolumn * 5101 102This function can also be used to make bitwise operators explicit. For103example::104 105  somecolumn.op("&")(0xFF)106 107is a bitwise AND of the value in ``somecolumn``.108 109:param opstring: a string which will be output as the infix operator110  between this element and the expression passed to the111  generated function.112 113:param precedence: precedence which the database is expected to apply114 to the operator in SQL expressions. This integer value acts as a hint115 for the SQL compiler to know when explicit parenthesis should be116 rendered around a particular operation. A lower number will cause the117 expression to be parenthesized when applied against another operator118 with higher precedence. The default value of ``0`` is lower than all119 operators except for the comma (``,``) and ``AS`` operators. A value120 of 100 will be higher or equal to all operators, and -100 will be121 lower than or equal to all operators.122 123 .. seealso::124 125    :ref:`faq_sql_expression_op_parenthesis` - detailed description126    of how the SQLAlchemy SQL compiler renders parenthesis127 128:param is_comparison: legacy; if True, the operator will be considered129 as a "comparison" operator, that is which evaluates to a boolean130 true/false value, like ``==``, ``>``, etc.  This flag is provided131 so that ORM relationships can establish that the operator is a132 comparison operator when used in a custom join condition.133 134 Using the ``is_comparison`` parameter is superseded by using the135 :meth:`.Operators.bool_op` method instead;  this more succinct136 operator sets this parameter automatically, but also provides137 correct :pep:`484` typing support as the returned object will138 express a "boolean" datatype, i.e. ``BinaryExpression[bool]``.139 140:param return_type: a :class:`.TypeEngine` class or object that will141  force the return type of an expression produced by this operator142  to be of that type.   By default, operators that specify143  :paramref:`.Operators.op.is_comparison` will resolve to144  :class:`.Boolean`, and those that do not will be of the same145  type as the left-hand operand.146 147:param python_impl: an optional Python function that can evaluate148 two Python values in the same way as this operator works when149 run on the database server.  Useful for in-Python SQL expression150 evaluation functions, such as for ORM hybrid attributes, and the151 ORM "evaluator" used to match objects in a session after a multi-row152 update or delete.153 154 e.g.::155 156    >>> expr = column("x").op("+", python_impl=lambda a, b: a + b)("y")157 158 The operator for the above expression will also work for non-SQL159 left and right objects::160 161    >>> expr.operator(5, 10)162    15163 164 .. versionadded:: 2.0165 166 167.. seealso::168 169    :meth:`.Operators.bool_op`170 171    :ref:`types_operators`172 173    :ref:`relationship_custom_operator`174 175)�python_implc�>�T"TU5$r:r6)r?�operatorr<s ��rA�against�Operators.op.<locals>.against5s����D�%�(�(rE�r?rrKrM)�	custom_op)r<�opstring�176precedence�
is_comparison�return_typererhrgs`      @rA�op�Operators.op�s0���|�����#�177��	)�	)��rEc�&�URUUSUS9$)a�Return a custom boolean operator.178 179This method is shorthand for calling180:meth:`.Operators.op` and passing the181:paramref:`.Operators.op.is_comparison`182flag with True.    A key advantage to using :meth:`.Operators.bool_op`183is that when using column constructs, the "boolean" nature of the184returned expression will be present for :pep:`484` purposes.185 186.. seealso::187 188    :meth:`.Operators.op`189 190T)rmrnre�rp)r<rlrmres    rA�bool_op�Operators.bool_op:s&��(�w�w��!��#�	�191�	192rEc�*�[[U55e)a�Operate on an argument.193 194This is the lowest level of operation, raises195:class:`NotImplementedError` by default.196 197Overriding this on a subclass can allow common198behavior to be applied to all operations.199For example, overriding :class:`.ColumnOperators`200to apply ``func.lower()`` to the left and right201side::202 203    class MyComparator(ColumnOperators):204        def operate(self, op, other, **kwargs):205            return op(func.lower(self), func.lower(other), **kwargs)206 207:param op:  Operator callable.208:param \*other: the 'other' side of the operation. Will209 be a single scalar for most operations.210:param \**kwargs: modifiers.  These may be passed by special211 operators such as :meth:`ColumnOperators.contains`.212 213 214��NotImplementedErrorr7�r<rpr?r@s    rArY�Operators.operateUs��4"�#�b�'�*�*rEc�*�[[U55e)zHReverse operate on an argument.215 216Usage is the same as :meth:`operate`.217 218rwrys    rA�reverse_operate�Operators.reverse_operatess��"�#�b�'�*�*rErj)rKrM)rFNN)rlr7rm�intrn�boolroz7Optional[Union[Type[TypeEngine[Any]], TypeEngine[Any]]]re�Optional[Callable[..., Any]]rK�Callable[[Any], Operators])rN)rlr7rmr~rer�rKr�)rpr4r?rr@rrKrM)r8rOrPrQrRrSr[r^rbrprtrY�__sa_operate__r|rUr6rErArMrMzs�����I�)�2(�2!�*�#�
�48�i��i��i��	i�219220�i�2�i�221$�i�\�48�	222��223��224�2�	225�226227$�228�6+��+�(+�+�7:�+�	�+�8�N�+��+�'*�+�69�+�	�+rErMc���\rSrSrSrSrSrS
SSjjrSSjrSSjrSSjr	\229SSS	jj5r\230SSS231jj5rSSSjjrSrg)rki~a}Represent a 'custom' operator.232 233:class:`.custom_op` is normally instantiated when the234:meth:`.Operators.op` or :meth:`.Operators.bool_op` methods235are used to create a custom operator callable.  The class can also be236used directly when programmatically constructing expressions.   E.g.237to represent the "factorial" operation::238 239    from sqlalchemy.sql import UnaryExpression240    from sqlalchemy.sql import operators241    from sqlalchemy import Numeric242 243    unary = UnaryExpression(244        table.c.somecolumn, modifier=operators.custom_op("!"), type_=Numeric245    )246 247.. seealso::248 249    :meth:`.Operators.op`250 251    :meth:`.Operators.bool_op`252 253)rlrmrn�natural_self_precedent�eager_groupingroreNc��XlX lX0lXPlX`lU(aURU5OSUlXplgr:)rlrmrnr�r��_to_instancerore)r<rlrmrnror�r�res        rA�__init__�custom_op.__init__�sB��!�
�$��*��&<�#�,��5@�K�$�$�[�1�d�	
��'�rEc�r�[U[5=(a! UR5UR5:H$r:)�254isinstancerk�	_hash_keyrZs  rA�__eq__�custom_op.__eq__�s,���u�i�(�
6����!�T�^�^�%5�5�	255rEc�4�[UR55$r:)�hashr�ras rA�__hash__�custom_op.__hash__�s���D�N�N�$�%�%rEc���URURURURURUR256UR(aURR4$S4$r:)�	__class__rlrmrnr�r�ro�_static_cache_keyras rAr��custom_op._hash_key�sd���N�N��M�M��O�O�����'�'����26�2B�2B�D���.�.�257�	258�IM�259�	260rEc��gr:r6r;s     rArB�custom_op.__call__�rDrEc��gr:r6r;s     rArBr��rGrEc���[US5(aUR"X/UQ70UD6$UR(aUR"X/UQ70UD6$[R"SUR261<S35e)Nr�zCustom operator zX can't be used with plain Python objects unless it includes the 'python_impl' parameter.)�hasattrrYrer'�InvalidRequestErrorrlr;s     rArBr��sx���4�)�*�*��<�<��>�e�>�v�>�>�
�
�
��#�#�D�B�%�B�6�B�B��)�)�"�4�=�=�"3�4+�+��
rE)r�rnr�rlrmrero)rFNFFN)rlr7rmr~rnrroz5Optional[Union[Type[TypeEngine[_T]], TypeEngine[_T]]]r�rr�rrer�)r?rrKr�rKr~)rKz"Union[CacheConst, Tuple[Any, ...]]r:rIrLrN)
r8rOrPrQrRrSr�r�r�r�rrBrUr6rErArkrk~sT���0�H��I��#�
�',�$�48�'��'��'��	'�262263�'�!%�'��'�2�'�,264�&�	265�� $�!�+�!��!��	!�266�!�267�
!��!�� $�������	�268��269�
��� $�������	�270��271�
�rErkc���\rSrSr%SrSrSrS\S'\R(aSLSjr272SLSjrSMS	jrSMS273jr
\	(aSNSjrO\RrSMSjrSMS
jrSMSjrSMSjr\	(aSMSjrO\rSMSjrSMSjrSOSjrSMSjrSPSjrSMSjrSMSjrSMSjrSMSjrSQSRSjjrSQSRSjjrSMSjr SMSjr!SMSjr"SOSjr#SMS jr$SMS!jr%SMS"jr&SMS#jr'\	(aSMS$jr(O\'r(SQSRS%jjr)\	(aSQSRS&jjr*O\)r*SQSRS'jjr+\	(aSQSRS(jjr,O\+r,SMS)jr-SMS*jr.\	(aSMS+jr/O\.r/SSSTS,jjr0SSSTS-jjr1SSSTS.jjr2SSSTS/jjr3SUS0jr4SUS1jr5SVS2jr6SQSWS3jjr7SQSXS4jjr8SOS5jr9SOS6jr:SOS7jr;\	(aSOS8jr<O\;r<SOS9jr=\	(aSOS:jr>O\=r>SYS;jr?SMS<jr@SMS=jrASMS>jrBSMS?jrCSZS[S@jjrDSOSAjrESOSBjrFSOSCjrGSMSDjrHSMSEjrISMSFjrJSMSGjrKSMSHjrLSMSIjrMSMSJjrNSMSKjrOSrPg)\�ColumnOperatorsi�a�Defines boolean, comparison, and other operators for274:class:`_expression.ColumnElement` expressions.275 276By default, all methods call down to277:meth:`.operate` or :meth:`.reverse_operate`,278passing in the appropriate operator function from the279Python builtin ``operator`` module or280a SQLAlchemy-specific operator function from281:mod:`sqlalchemy.expression.operators`.   For example282the ``__eq__`` function::283 284    def __eq__(self, other):285        return self.operate(operators.eq, other)286 287Where ``operators.eq`` is essentially::288 289    def eq(a, b):290        return a == b291 292The core column expression unit :class:`_expression.ColumnElement`293overrides :meth:`.Operators.operate` and others294to return further :class:`_expression.ColumnElement` constructs,295so that the ``==`` operation above is replaced by a clause296construct.297 298.. seealso::299 300    :ref:`types_operators`301 302    :attr:`.TypeEngine.comparator_factory`303 304    :class:`.ColumnOperators`305 306    :class:`.PropComparator`307 308r6Nz
Literal[None]�	timetuplec��gr:r6rys    rArY�ColumnOperators.operate���!rEc��gr:r6rys    rAr|�ColumnOperators.reverse_operate#r�rEc�.�UR[U5$)zTImplement the ``<`` operator.309 310In a column context, produces the clause ``a < b``.311 312)rYrrZs  rA�__lt__�ColumnOperators.__lt__'����|�|�B��&�&rEc�.�UR[U5$)zVImplement the ``<=`` operator.313 314In a column context, produces the clause ``a <= b``.315 316)rYrrZs  rA�__le__�ColumnOperators.__le__/r�rEc��gr:r6ras rAr��ColumnOperators.__hash__<s��3rEc�.�UR[U5$)z�Implement the ``==`` operator.317 318In a column context, produces the clause ``a = b``.319If the target is ``None``, produces ``a IS NULL``.320 321)rYrrZs  rAr��ColumnOperators.__eq__A����|�|�B��&�&rEc�.�UR[U5$)z�Implement the ``!=`` operator.322 323In a column context, produces the clause ``a != b``.324If the target is ``None``, produces ``a IS NOT NULL``.325 326)rYrrZs  rA�__ne__�ColumnOperators.__ne__Jr�rEc�.�UR[U5$)z�Implement the ``IS DISTINCT FROM`` operator.327 328Renders "a IS DISTINCT FROM b" on most platforms;329on some such as SQLite may render "a IS NOT b".330 331)rY�is_distinct_fromrZs  rAr�� ColumnOperators.is_distinct_fromSs���|�|�,�e�4�4rEc�.�UR[U5$)a]Implement the ``IS NOT DISTINCT FROM`` operator.332 333Renders "a IS NOT DISTINCT FROM b" on most platforms;334on some such as SQLite may render "a IS b".335 336.. versionchanged:: 1.4 The ``is_not_distinct_from()`` operator is337   renamed from ``isnot_distinct_from()`` in previous releases.338   The previous name remains available for backwards compatibility.339 340)rY�is_not_distinct_fromrZs  rAr��$ColumnOperators.is_not_distinct_from\s���|�|�0�%�8�8rEc��gr:r6rZs  rA�isnot_distinct_from�#ColumnOperators.isnot_distinct_fromls��crEc�.�UR[U5$)zTImplement the ``>`` operator.341 342In a column context, produces the clause ``a > b``.343 344)rYrrZs  rA�__gt__�ColumnOperators.__gt__qr�rEc�.�UR[U5$)zVImplement the ``>=`` operator.345 346In a column context, produces the clause ``a >= b``.347 348)rYr349rZs  rA�__ge__�ColumnOperators.__ge__yr�rEc�,�UR[5$)zQImplement the ``-`` operator.350 351In a column context, produces the clause ``-a``.352 353)rYrras rA�__neg__�ColumnOperators.__neg__�s���|�|�C� � rEc�.�UR[U5$r:)rYrrZs  rA�__contains__�ColumnOperators.__contains__�s���|�|�H�e�,�,rEc�.�UR[U5$)zsImplement the [] operator.354 355This can be used by some database-specific types356such as PostgreSQL ARRAY and HSTORE.357 358)rYr)r<�indexs  rA�__getitem__�ColumnOperators.__getitem__�s���|�|�G�U�+�+rEc�.�UR[U5$)z�implement the << operator.359 360Not used by SQLAlchemy core, this is provided361for custom operator systems which want to use362<< as an extension point.363)rYrrZs  rA�364__lshift__�ColumnOperators.__lshift__�����|�|�F�E�*�*rEc�.�UR[U5$)z�implement the >> operator.365 366Not used by SQLAlchemy core, this is provided367for custom operator systems which want to use368>> as an extension point.369)rYrrZs  rA�370__rshift__�ColumnOperators.__rshift__�r�rEc�.�UR[U5$)z�Implement the 'concat' operator.371 372In a column context, produces the clause ``a || b``,373or uses the ``concat()`` operator on MySQL.374 375)rY�	concat_oprZs  rA�concat�ColumnOperators.concat�s���|�|�I�u�-�-rEc�.�UR[U5$)zdImplement an 'rconcat' operator.376 377this is for internal use at the moment378 379.. versionadded:: 1.4.40380 381)r|r�rZs  rA�_rconcat�ColumnOperators._rconcat�s���#�#�I�u�5�5rEc�*�UR[XS9$)a�Implement the ``like`` operator.382 383In a column context, produces the expression:384 385.. sourcecode:: sql386 387    a LIKE other388 389E.g.::390 391    stmt = select(sometable).where(sometable.c.column.like("%foobar%"))392 393:param other: expression to be compared394:param escape: optional escape character, renders the ``ESCAPE``395  keyword, e.g.::396 397    somecolumn.like("foo/%bar", escape="/")398 399.. seealso::400 401    :meth:`.ColumnOperators.ilike`402 403��escape)rY�like_op�r<r?r�s   rA�like�ColumnOperators.like�s��4�|�|�G�U�|�:�:rEc�*�UR[XS9$)a;Implement the ``ilike`` operator, e.g. case insensitive LIKE.404 405In a column context, produces an expression either of the form:406 407.. sourcecode:: sql408 409    lower(a) LIKE lower(other)410 411Or on backends that support the ILIKE operator:412 413.. sourcecode:: sql414 415    a ILIKE other416 417E.g.::418 419    stmt = select(sometable).where(sometable.c.column.ilike("%foobar%"))420 421:param other: expression to be compared422:param escape: optional escape character, renders the ``ESCAPE``423  keyword, e.g.::424 425    somecolumn.ilike("foo/%bar", escape="/")426 427.. seealso::428 429    :meth:`.ColumnOperators.like`430 431r�)rY�ilike_opr�s   rA�ilike�ColumnOperators.ilike�s��@�|�|�H�e�|�;�;rEc�.�UR[U5$)z�Produce a bitwise XOR operation, typically via the ``^``432operator, or ``#`` for PostgreSQL.433 434.. versionadded:: 2.0.2435 436.. seealso::437 438    :ref:`operators_bitwise`439 440)rY�bitwise_xor_oprZs  rA�bitwise_xor�ColumnOperators.bitwise_xor�����|�|�N�E�2�2rEc�.�UR[U5$)z�Produce a bitwise OR operation, typically via the ``|``441operator.442 443.. versionadded:: 2.0.2444 445.. seealso::446 447    :ref:`operators_bitwise`448 449)rY�
bitwise_or_oprZs  rA�450bitwise_or�ColumnOperators.bitwise_ors���|�|�M�5�1�1rEc�.�UR[U5$)z�Produce a bitwise AND operation, typically via the ``&``451operator.452 453.. versionadded:: 2.0.2454 455.. seealso::456 457    :ref:`operators_bitwise`458 459)rY�bitwise_and_oprZs  rA�bitwise_and�ColumnOperators.bitwise_andr�rEc�,�UR[5$)z�Produce a bitwise NOT operation, typically via the ``~``460operator.461 462.. versionadded:: 2.0.2463 464.. seealso::465 466    :ref:`operators_bitwise`467 468)rY�bitwise_not_opras rA�bitwise_not�ColumnOperators.bitwise_not"s���|�|�N�+�+rEc�.�UR[U5$)z�Produce a bitwise LSHIFT operation, typically via the ``<<``469operator.470 471.. versionadded:: 2.0.2472 473.. seealso::474 475    :ref:`operators_bitwise`476 477)rY�bitwise_lshift_oprZs  rA�bitwise_lshift�ColumnOperators.bitwise_lshift0����|�|�-�u�5�5rEc�.�UR[U5$)z�Produce a bitwise RSHIFT operation, typically via the ``>>``478operator.479 480.. versionadded:: 2.0.2481 482.. seealso::483 484    :ref:`operators_bitwise`485 486)rY�bitwise_rshift_oprZs  rA�bitwise_rshift�ColumnOperators.bitwise_rshift>r�rEc�.�UR[U5$)a�487Implement the ``in`` operator.488 489In a column context, produces the clause ``column IN <other>``.490 491The given parameter ``other`` may be:492 493* A list of literal values,494  e.g.::495 496    stmt.where(column.in_([1, 2, 3]))497 498  In this calling form, the list of items is converted to a set of499  bound parameters the same length as the list given:500 501  .. sourcecode:: sql502 503    WHERE COL IN (?, ?, ?)504 505* A list of tuples may be provided if the comparison is against a506  :func:`.tuple_` containing multiple expressions::507 508    from sqlalchemy import tuple_509 510    stmt.where(tuple_(col1, col2).in_([(1, 10), (2, 20), (3, 30)]))511 512* An empty list,513  e.g.::514 515    stmt.where(column.in_([]))516 517  In this calling form, the expression renders an "empty set"518  expression.  These expressions are tailored to individual backends519  and are generally trying to get an empty SELECT statement as a520  subquery.  Such as on SQLite, the expression is:521 522  .. sourcecode:: sql523 524    WHERE col IN (SELECT 1 FROM (SELECT 1) WHERE 1!=1)525 526  .. versionchanged:: 1.4  empty IN expressions now use an527     execution-time generated SELECT subquery in all cases.528 529* A bound parameter, e.g. :func:`.bindparam`, may be used if it530  includes the :paramref:`.bindparam.expanding` flag::531 532    stmt.where(column.in_(bindparam("value", expanding=True)))533 534  In this calling form, the expression renders a special non-SQL535  placeholder expression that looks like:536 537  .. sourcecode:: sql538 539    WHERE COL IN ([EXPANDING_value])540 541  This placeholder expression is intercepted at statement execution542  time to be converted into the variable number of bound parameter543  form illustrated earlier.   If the statement were executed as::544 545    connection.execute(stmt, {"value": [1, 2, 3]})546 547  The database would be passed a bound parameter for each value:548 549  .. sourcecode:: sql550 551    WHERE COL IN (?, ?, ?)552 553  .. versionadded:: 1.2 added "expanding" bound parameters554 555  If an empty list is passed, a special "empty list" expression,556  which is specific to the database in use, is rendered.  On557  SQLite this would be:558 559  .. sourcecode:: sql560 561    WHERE COL IN (SELECT 1 FROM (SELECT 1) WHERE 1!=1)562 563  .. versionadded:: 1.3 "expanding" bound parameters now support564     empty lists565 566* a :func:`_expression.select` construct, which is usually a567  correlated scalar select::568 569    stmt.where(570        column.in_(select(othertable.c.y).where(table.c.x == othertable.c.x))571    )572 573  In this calling form, :meth:`.ColumnOperators.in_` renders as given:574 575  .. sourcecode:: sql576 577    WHERE COL IN (SELECT othertable.y578    FROM othertable WHERE othertable.x = table.x)579 580:param other: a list of literals, a :func:`_expression.select`581 construct, or a :func:`.bindparam` construct that includes the582 :paramref:`.bindparam.expanding` flag set to True.583 584)rY�in_oprZs  rA�in_�ColumnOperators.in_Ls��F�|�|�E�5�)�)rEc�.�UR[U5$)aimplement the ``NOT IN`` operator.585 586This is equivalent to using negation with587:meth:`.ColumnOperators.in_`, i.e. ``~x.in_(y)``.588 589In the case that ``other`` is an empty sequence, the compiler590produces an "empty not in" expression.   This defaults to the591expression "1 = 1" to produce true in all cases.  The592:paramref:`_sa.create_engine.empty_in_strategy` may be used to593alter this behavior.594 595.. versionchanged:: 1.4 The ``not_in()`` operator is renamed from596   ``notin_()`` in previous releases.  The previous name remains597   available for backwards compatibility.598 599.. versionchanged:: 1.2  The :meth:`.ColumnOperators.in_` and600   :meth:`.ColumnOperators.not_in` operators601   now produce a "static" expression for an empty IN sequence602   by default.603 604.. seealso::605 606    :meth:`.ColumnOperators.in_`607 608)rY�	not_in_oprZs  rA�not_in�ColumnOperators.not_in�s��4�|�|�I�u�-�-rEc��gr:r6rZs  rA�notin_�ColumnOperators.notin_�s��rEc�*�UR[XS9$)agimplement the ``NOT LIKE`` operator.609 610This is equivalent to using negation with611:meth:`.ColumnOperators.like`, i.e. ``~x.like(y)``.612 613.. versionchanged:: 1.4 The ``not_like()`` operator is renamed from614   ``notlike()`` in previous releases.  The previous name remains615   available for backwards compatibility.616 617.. seealso::618 619    :meth:`.ColumnOperators.like`620 621r�)rY�not_like_opr�s   rA�not_like�ColumnOperators.not_like�s��"�|�|�K��|�>�>rEc��gr:r6r�s   rA�notlike�ColumnOperators.notlike�r�rEc�*�UR[XS9$)amimplement the ``NOT ILIKE`` operator.622 623This is equivalent to using negation with624:meth:`.ColumnOperators.ilike`, i.e. ``~x.ilike(y)``.625 626.. versionchanged:: 1.4 The ``not_ilike()`` operator is renamed from627   ``notilike()`` in previous releases.  The previous name remains628   available for backwards compatibility.629 630.. seealso::631 632    :meth:`.ColumnOperators.ilike`633 634r�)rY�not_ilike_opr�s   rA�	not_ilike�ColumnOperators.not_ilike�s��"�|�|�L�%�|�?�?rEc��gr:r6r�s   rA�notilike�ColumnOperators.notiliker�rEc�.�UR[U5$)a'Implement the ``IS`` operator.635 636Normally, ``IS`` is generated automatically when comparing to a637value of ``None``, which resolves to ``NULL``.  However, explicit638usage of ``IS`` may be desirable if comparing to boolean values639on certain platforms.640 641.. seealso:: :meth:`.ColumnOperators.is_not`642 643)rY�is_rZs  rAr�ColumnOperators.is_s���|�|�C��'�'rEc�.�UR[U5$)a�Implement the ``IS NOT`` operator.644 645Normally, ``IS NOT`` is generated automatically when comparing to a646value of ``None``, which resolves to ``NULL``.  However, explicit647usage of ``IS NOT`` may be desirable if comparing to boolean values648on certain platforms.649 650.. versionchanged:: 1.4 The ``is_not()`` operator is renamed from651   ``isnot()`` in previous releases.  The previous name remains652   available for backwards compatibility.653 654.. seealso:: :meth:`.ColumnOperators.is_`655 656)rY�is_notrZs  rAr�ColumnOperators.is_nots���|�|�F�E�*�*rEc��gr:r6rZs  rA�isnot�ColumnOperators.isnot0s��rEc�,�UR[XUS9$)a�	Implement the ``startswith`` operator.657 658Produces a LIKE expression that tests against a match for the start659of a string value:660 661.. sourcecode:: sql662 663    column LIKE <other> || '%'664 665E.g.::666 667    stmt = select(sometable).where(sometable.c.column.startswith("foobar"))668 669Since the operator uses ``LIKE``, wildcard characters670``"%"`` and ``"_"`` that are present inside the <other> expression671will behave like wildcards as well.   For literal string672values, the :paramref:`.ColumnOperators.startswith.autoescape` flag673may be set to ``True`` to apply escaping to occurrences of these674characters within the string value so that they match as themselves675and not as wildcard characters.  Alternatively, the676:paramref:`.ColumnOperators.startswith.escape` parameter will establish677a given character as an escape character which can be of use when678the target expression is not a literal string.679 680:param other: expression to be compared.   This is usually a plain681  string value, but can also be an arbitrary SQL expression.  LIKE682  wildcard characters ``%`` and ``_`` are not escaped by default unless683  the :paramref:`.ColumnOperators.startswith.autoescape` flag is684  set to True.685 686:param autoescape: boolean; when True, establishes an escape character687  within the LIKE expression, then applies it to all occurrences of688  ``"%"``, ``"_"`` and the escape character itself within the689  comparison value, which is assumed to be a literal string and not a690  SQL expression.691 692  An expression such as::693 694    somecolumn.startswith("foo%bar", autoescape=True)695 696  Will render as:697 698  .. sourcecode:: sql699 700    somecolumn LIKE :param || '%' ESCAPE '/'701 702  With the value of ``:param`` as ``"foo/%bar"``.703 704:param escape: a character which when given will render with the705  ``ESCAPE`` keyword to establish that character as the escape706  character.  This character can then be placed preceding occurrences707  of ``%`` and ``_`` to allow them to act as themselves and not708  wildcard characters.709 710  An expression such as::711 712    somecolumn.startswith("foo/%bar", escape="^")713 714  Will render as:715 716  .. sourcecode:: sql717 718    somecolumn LIKE :param || '%' ESCAPE '^'719 720  The parameter may also be combined with721  :paramref:`.ColumnOperators.startswith.autoescape`::722 723    somecolumn.startswith("foo%bar^bat", escape="^", autoescape=True)724 725  Where above, the given literal parameter will be converted to726  ``"foo^%bar^^bat"`` before being passed to the database.727 728.. seealso::729 730    :meth:`.ColumnOperators.endswith`731 732    :meth:`.ColumnOperators.contains`733 734    :meth:`.ColumnOperators.like`735 736�r��737autoescape)rY�
startswith_op�r<r?r�r%s    rA�738startswith�ColumnOperators.startswith5s"��n�|�|��5�J��739�	740rEc�,�UR[XUS9$)a6741Implement the ``istartswith`` operator, e.g. case insensitive742version of :meth:`.ColumnOperators.startswith`.743 744Produces a LIKE expression that tests against an insensitive745match for the start of a string value:746 747.. sourcecode:: sql748 749    lower(column) LIKE lower(<other>) || '%'750 751E.g.::752 753    stmt = select(sometable).where(sometable.c.column.istartswith("foobar"))754 755Since the operator uses ``LIKE``, wildcard characters756``"%"`` and ``"_"`` that are present inside the <other> expression757will behave like wildcards as well.   For literal string758values, the :paramref:`.ColumnOperators.istartswith.autoescape` flag759may be set to ``True`` to apply escaping to occurrences of these760characters within the string value so that they match as themselves761and not as wildcard characters.  Alternatively, the762:paramref:`.ColumnOperators.istartswith.escape` parameter will763establish a given character as an escape character which can be of764use when the target expression is not a literal string.765 766:param other: expression to be compared.   This is usually a plain767  string value, but can also be an arbitrary SQL expression.  LIKE768  wildcard characters ``%`` and ``_`` are not escaped by default unless769  the :paramref:`.ColumnOperators.istartswith.autoescape` flag is770  set to True.771 772:param autoescape: boolean; when True, establishes an escape character773  within the LIKE expression, then applies it to all occurrences of774  ``"%"``, ``"_"`` and the escape character itself within the775  comparison value, which is assumed to be a literal string and not a776  SQL expression.777 778  An expression such as::779 780    somecolumn.istartswith("foo%bar", autoescape=True)781 782  Will render as:783 784  .. sourcecode:: sql785 786    lower(somecolumn) LIKE lower(:param) || '%' ESCAPE '/'787 788  With the value of ``:param`` as ``"foo/%bar"``.789 790:param escape: a character which when given will render with the791  ``ESCAPE`` keyword to establish that character as the escape792  character.  This character can then be placed preceding occurrences793  of ``%`` and ``_`` to allow them to act as themselves and not794  wildcard characters.795 796  An expression such as::797 798    somecolumn.istartswith("foo/%bar", escape="^")799 800  Will render as:801 802  .. sourcecode:: sql803 804    lower(somecolumn) LIKE lower(:param) || '%' ESCAPE '^'805 806  The parameter may also be combined with807  :paramref:`.ColumnOperators.istartswith.autoescape`::808 809    somecolumn.istartswith("foo%bar^bat", escape="^", autoescape=True)810 811  Where above, the given literal parameter will be converted to812  ``"foo^%bar^^bat"`` before being passed to the database.813 814.. seealso::815 816    :meth:`.ColumnOperators.startswith`817r$)rY�istartswith_opr's    rA�istartswith�ColumnOperators.istartswith�s"��f�|�|��E�Z��818�	819rEc�,�UR[XUS9$)a�	Implement the 'endswith' operator.820 821Produces a LIKE expression that tests against a match for the end822of a string value:823 824.. sourcecode:: sql825 826    column LIKE '%' || <other>827 828E.g.::829 830    stmt = select(sometable).where(sometable.c.column.endswith("foobar"))831 832Since the operator uses ``LIKE``, wildcard characters833``"%"`` and ``"_"`` that are present inside the <other> expression834will behave like wildcards as well.   For literal string835values, the :paramref:`.ColumnOperators.endswith.autoescape` flag836may be set to ``True`` to apply escaping to occurrences of these837characters within the string value so that they match as themselves838and not as wildcard characters.  Alternatively, the839:paramref:`.ColumnOperators.endswith.escape` parameter will establish840a given character as an escape character which can be of use when841the target expression is not a literal string.842 843:param other: expression to be compared.   This is usually a plain844  string value, but can also be an arbitrary SQL expression.  LIKE845  wildcard characters ``%`` and ``_`` are not escaped by default unless846  the :paramref:`.ColumnOperators.endswith.autoescape` flag is847  set to True.848 849:param autoescape: boolean; when True, establishes an escape character850  within the LIKE expression, then applies it to all occurrences of851  ``"%"``, ``"_"`` and the escape character itself within the852  comparison value, which is assumed to be a literal string and not a853  SQL expression.854 855  An expression such as::856 857    somecolumn.endswith("foo%bar", autoescape=True)858 859  Will render as:860 861  .. sourcecode:: sql862 863    somecolumn LIKE '%' || :param ESCAPE '/'864 865  With the value of ``:param`` as ``"foo/%bar"``.866 867:param escape: a character which when given will render with the868  ``ESCAPE`` keyword to establish that character as the escape869  character.  This character can then be placed preceding occurrences870  of ``%`` and ``_`` to allow them to act as themselves and not871  wildcard characters.872 873  An expression such as::874 875    somecolumn.endswith("foo/%bar", escape="^")876 877  Will render as:878 879  .. sourcecode:: sql880 881    somecolumn LIKE '%' || :param ESCAPE '^'882 883  The parameter may also be combined with884  :paramref:`.ColumnOperators.endswith.autoescape`::885 886    somecolumn.endswith("foo%bar^bat", escape="^", autoescape=True)887 888  Where above, the given literal parameter will be converted to889  ``"foo^%bar^^bat"`` before being passed to the database.890 891.. seealso::892 893    :meth:`.ColumnOperators.startswith`894 895    :meth:`.ColumnOperators.contains`896 897    :meth:`.ColumnOperators.like`898 899r$)rY�endswith_opr's    rA�endswith�ColumnOperators.endswith�s"��n�|�|���*��900�	901rEc�,�UR[XUS9$)a902Implement the ``iendswith`` operator, e.g. case insensitive903version of :meth:`.ColumnOperators.endswith`.904 905Produces a LIKE expression that tests against an insensitive match906for the end of a string value:907 908.. sourcecode:: sql909 910    lower(column) LIKE '%' || lower(<other>)911 912E.g.::913 914    stmt = select(sometable).where(sometable.c.column.iendswith("foobar"))915 916Since the operator uses ``LIKE``, wildcard characters917``"%"`` and ``"_"`` that are present inside the <other> expression918will behave like wildcards as well.   For literal string919values, the :paramref:`.ColumnOperators.iendswith.autoescape` flag920may be set to ``True`` to apply escaping to occurrences of these921characters within the string value so that they match as themselves922and not as wildcard characters.  Alternatively, the923:paramref:`.ColumnOperators.iendswith.escape` parameter will establish924a given character as an escape character which can be of use when925the target expression is not a literal string.926 927:param other: expression to be compared.   This is usually a plain928  string value, but can also be an arbitrary SQL expression.  LIKE929  wildcard characters ``%`` and ``_`` are not escaped by default unless930  the :paramref:`.ColumnOperators.iendswith.autoescape` flag is931  set to True.932 933:param autoescape: boolean; when True, establishes an escape character934  within the LIKE expression, then applies it to all occurrences of935  ``"%"``, ``"_"`` and the escape character itself within the936  comparison value, which is assumed to be a literal string and not a937  SQL expression.938 939  An expression such as::940 941    somecolumn.iendswith("foo%bar", autoescape=True)942 943  Will render as:944 945  .. sourcecode:: sql946 947    lower(somecolumn) LIKE '%' || lower(:param) ESCAPE '/'948 949  With the value of ``:param`` as ``"foo/%bar"``.950 951:param escape: a character which when given will render with the952  ``ESCAPE`` keyword to establish that character as the escape953  character.  This character can then be placed preceding occurrences954  of ``%`` and ``_`` to allow them to act as themselves and not955  wildcard characters.956 957  An expression such as::958 959    somecolumn.iendswith("foo/%bar", escape="^")960 961  Will render as:962 963  .. sourcecode:: sql964 965    lower(somecolumn) LIKE '%' || lower(:param) ESCAPE '^'966 967  The parameter may also be combined with968  :paramref:`.ColumnOperators.iendswith.autoescape`::969 970    somecolumn.endswith("foo%bar^bat", escape="^", autoescape=True)971 972  Where above, the given literal parameter will be converted to973  ``"foo^%bar^^bat"`` before being passed to the database.974 975.. seealso::976 977    :meth:`.ColumnOperators.endswith`978r$)rY�iendswith_opr's    rA�	iendswith�ColumnOperators.iendswithBs"��f�|�|��%�:��979�	980rEc�2�UR"[U40UD6$)a�	Implement the 'contains' operator.981 982Produces a LIKE expression that tests against a match for the middle983of a string value:984 985.. sourcecode:: sql986 987    column LIKE '%' || <other> || '%'988 989E.g.::990 991    stmt = select(sometable).where(sometable.c.column.contains("foobar"))992 993Since the operator uses ``LIKE``, wildcard characters994``"%"`` and ``"_"`` that are present inside the <other> expression995will behave like wildcards as well.   For literal string996values, the :paramref:`.ColumnOperators.contains.autoescape` flag997may be set to ``True`` to apply escaping to occurrences of these998characters within the string value so that they match as themselves999and not as wildcard characters.  Alternatively, the1000:paramref:`.ColumnOperators.contains.escape` parameter will establish1001a given character as an escape character which can be of use when1002the target expression is not a literal string.1003 1004:param other: expression to be compared.   This is usually a plain1005  string value, but can also be an arbitrary SQL expression.  LIKE1006  wildcard characters ``%`` and ``_`` are not escaped by default unless1007  the :paramref:`.ColumnOperators.contains.autoescape` flag is1008  set to True.1009 1010:param autoescape: boolean; when True, establishes an escape character1011  within the LIKE expression, then applies it to all occurrences of1012  ``"%"``, ``"_"`` and the escape character itself within the1013  comparison value, which is assumed to be a literal string and not a1014  SQL expression.1015 1016  An expression such as::1017 1018    somecolumn.contains("foo%bar", autoescape=True)1019 1020  Will render as:1021 1022  .. sourcecode:: sql1023 1024    somecolumn LIKE '%' || :param || '%' ESCAPE '/'1025 1026  With the value of ``:param`` as ``"foo/%bar"``.1027 1028:param escape: a character which when given will render with the1029  ``ESCAPE`` keyword to establish that character as the escape1030  character.  This character can then be placed preceding occurrences1031  of ``%`` and ``_`` to allow them to act as themselves and not1032  wildcard characters.1033 1034  An expression such as::1035 1036    somecolumn.contains("foo/%bar", escape="^")1037 1038  Will render as:1039 1040  .. sourcecode:: sql1041 1042    somecolumn LIKE '%' || :param || '%' ESCAPE '^'1043 1044  The parameter may also be combined with1045  :paramref:`.ColumnOperators.contains.autoescape`::1046 1047    somecolumn.contains("foo%bar^bat", escape="^", autoescape=True)1048 1049  Where above, the given literal parameter will be converted to1050  ``"foo^%bar^^bat"`` before being passed to the database.1051 1052.. seealso::1053 1054    :meth:`.ColumnOperators.startswith`1055 1056    :meth:`.ColumnOperators.endswith`1057 1058    :meth:`.ColumnOperators.like`1059 1060 1061)rY�contains_op�r<r?�kws   rAr�ColumnOperators.contains�s��f�|�|�K��5�"�5�5rEc�2�UR"[U40UD6$)a61062Implement the ``icontains`` operator, e.g. case insensitive1063version of :meth:`.ColumnOperators.contains`.1064 1065Produces a LIKE expression that tests against an insensitive match1066for the middle of a string value:1067 1068.. sourcecode:: sql1069 1070    lower(column) LIKE '%' || lower(<other>) || '%'1071 1072E.g.::1073 1074    stmt = select(sometable).where(sometable.c.column.icontains("foobar"))1075 1076Since the operator uses ``LIKE``, wildcard characters1077``"%"`` and ``"_"`` that are present inside the <other> expression1078will behave like wildcards as well.   For literal string1079values, the :paramref:`.ColumnOperators.icontains.autoescape` flag1080may be set to ``True`` to apply escaping to occurrences of these1081characters within the string value so that they match as themselves1082and not as wildcard characters.  Alternatively, the1083:paramref:`.ColumnOperators.icontains.escape` parameter will establish1084a given character as an escape character which can be of use when1085the target expression is not a literal string.1086 1087:param other: expression to be compared.   This is usually a plain1088  string value, but can also be an arbitrary SQL expression.  LIKE1089  wildcard characters ``%`` and ``_`` are not escaped by default unless1090  the :paramref:`.ColumnOperators.icontains.autoescape` flag is1091  set to True.1092 1093:param autoescape: boolean; when True, establishes an escape character1094  within the LIKE expression, then applies it to all occurrences of1095  ``"%"``, ``"_"`` and the escape character itself within the1096  comparison value, which is assumed to be a literal string and not a1097  SQL expression.1098 1099  An expression such as::1100 1101    somecolumn.icontains("foo%bar", autoescape=True)1102 1103  Will render as:1104 1105  .. sourcecode:: sql1106 1107    lower(somecolumn) LIKE '%' || lower(:param) || '%' ESCAPE '/'1108 1109  With the value of ``:param`` as ``"foo/%bar"``.1110 1111:param escape: a character which when given will render with the1112  ``ESCAPE`` keyword to establish that character as the escape1113  character.  This character can then be placed preceding occurrences1114  of ``%`` and ``_`` to allow them to act as themselves and not1115  wildcard characters.1116 1117  An expression such as::1118 1119    somecolumn.icontains("foo/%bar", escape="^")1120 1121  Will render as:1122 1123  .. sourcecode:: sql1124 1125    lower(somecolumn) LIKE '%' || lower(:param) || '%' ESCAPE '^'1126 1127  The parameter may also be combined with1128  :paramref:`.ColumnOperators.contains.autoescape`::1129 1130    somecolumn.icontains("foo%bar^bat", escape="^", autoescape=True)1131 1132  Where above, the given literal parameter will be converted to1133  ``"foo^%bar^^bat"`` before being passed to the database.1134 1135.. seealso::1136 1137    :meth:`.ColumnOperators.contains`1138 1139)rY�icontains_opr8s   rA�	icontains�ColumnOperators.icontains�s��^�|�|�L�%�6�2�6�6rEc�2�UR"[U40UD6$)a<Implements a database-specific 'match' operator.1140 1141:meth:`_sql.ColumnOperators.match` attempts to resolve to1142a MATCH-like function or operator provided by the backend.1143Examples include:1144 1145* PostgreSQL - renders ``x @@ plainto_tsquery(y)``1146 1147    .. versionchanged:: 2.0  ``plainto_tsquery()`` is used instead1148       of ``to_tsquery()`` for PostgreSQL now; for compatibility with1149       other forms, see :ref:`postgresql_match`.1150 1151 1152* MySQL - renders ``MATCH (x) AGAINST (y IN BOOLEAN MODE)``1153 1154  .. seealso::1155 1156        :class:`_mysql.match` - MySQL specific construct with1157        additional features.1158 1159* Oracle Database - renders ``CONTAINS(x, y)``1160* other backends may provide special implementations.1161* Backends without any special implementation will emit1162  the operator as "MATCH".  This is compatible with SQLite, for1163  example.1164 1165)rY�match_op)r<r?r@s   rA�match�ColumnOperators.match?s��8�|�|�H�e�6�v�6�6rEc�*�UR[XS9$)a�Implements a database-specific 'regexp match' operator.1166 1167E.g.::1168 1169    stmt = select(table.c.some_column).where(1170        table.c.some_column.regexp_match("^(b|c)")1171    )1172 1173:meth:`_sql.ColumnOperators.regexp_match` attempts to resolve to1174a REGEXP-like function or operator provided by the backend, however1175the specific regular expression syntax and flags available are1176**not backend agnostic**.1177 1178Examples include:1179 1180* PostgreSQL - renders ``x ~ y`` or ``x !~ y`` when negated.1181* Oracle Database - renders ``REGEXP_LIKE(x, y)``1182* SQLite - uses SQLite's ``REGEXP`` placeholder operator and calls into1183  the Python ``re.match()`` builtin.1184* other backends may provide special implementations.1185* Backends without any special implementation will emit1186  the operator as "REGEXP" or "NOT REGEXP".  This is compatible with1187  SQLite and MySQL, for example.1188 1189Regular expression support is currently implemented for Oracle1190Database, PostgreSQL, MySQL and MariaDB.  Partial support is available1191for SQLite.  Support among third-party dialects may vary.1192 1193:param pattern: The regular expression pattern string or column1194  clause.1195:param flags: Any regular expression string flags to apply, passed as1196  plain Python string only.  These flags are backend specific.1197  Some backends, like PostgreSQL and MariaDB, may alternatively1198  specify the flags as part of the pattern.1199  When using the ignore case flag 'i' in PostgreSQL, the ignore case1200  regexp match operator ``~*`` or ``!~*`` will be used.

Showing the first 1,200 of 1514 lines. Download the file for the rest.

codekingpro/portable-devtools · Team Ai