ó
    øÞ j‘  ã                  óº   • S SK Jr  S SKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  SSKJ
r
  SS	KJr  SS
KJr  SSKJr  SSKJr   " S S\\	R"                  \   5      rg)é    )Úannotations)ÚAnyé   )Úexc)Úutil)Ú	coercions)Úelements)Ú	operators)Úroles)Ú_generative)Ú
Generative)ÚSelfc                  ó€   ^ • \ rS rSr% SrSrSrS\S'   SU 4S jjr\	SS j5       r
\	SS	 j5       r\	SS
 j5       rSrU =r$ )Úmatché   aó  Produce a ``MATCH (X, Y) AGAINST ('TEXT')`` clause.

E.g.::

    from sqlalchemy import desc
    from sqlalchemy.dialects.mysql import match

    match_expr = match(
        users_table.c.firstname,
        users_table.c.lastname,
        against="Firstname Lastname",
    )

    stmt = (
        select(users_table)
        .where(match_expr.in_boolean_mode())
        .order_by(desc(match_expr))
    )

Would produce SQL resembling:

.. sourcecode:: sql

    SELECT id, firstname, lastname
    FROM user
    WHERE MATCH(firstname, lastname) AGAINST (:param_1 IN BOOLEAN MODE)
    ORDER BY MATCH(firstname, lastname) AGAINST (:param_2) DESC

The :func:`_mysql.match` function is a standalone version of the
:meth:`_sql.ColumnElement.match` method available on all
SQL expressions, as when :meth:`_expression.ColumnElement.match` is
used, but allows to pass multiple columns

:param cols: column expressions to match against

:param against: expression to be compared towards

:param in_boolean_mode: boolean, set "boolean mode" to true

:param in_natural_language_mode: boolean , set "natural language" to true

:param with_query_expansion: boolean, set "query expansion" to true

.. versionadded:: 1.4.19

.. seealso::

    :meth:`_expression.ColumnElement.match`

Úmysql_matchTzutil.immutabledict[str, Any]Ú	modifiersc                ór  >• U(       d  [         R                  " S5      eUR                  SS 5      nUc  [         R                  " S5      e[        R                  " [
        R                  U5      n[        R                  R                  [        R                  US9nSUl        [        R                  " UR                  SS5      UR                  SS5      UR                  SS5      S	.5      nU(       a(  [         R                  " S
SR                  U5      -  5      e[         TU ]E  XC[        R$                  US9  g )Nzcolumns are requiredÚagainstzagainst is required)ÚclausesFÚin_boolean_modeÚin_natural_language_modeÚwith_query_expansion)Úmysql_boolean_modeÚmysql_natural_languageÚmysql_query_expansionzunknown arguments: %sz, ©r   )r   ÚArgumentErrorÚpopr   Úexpectr   ÚExpressionElementRoler	   ÚBooleanClauseListÚ_construct_rawr
   Úcomma_opÚgroupr   ÚimmutabledictÚjoinÚsuperÚ__init__Úmatch_op)ÚselfÚcolsÚkwr   ÚleftÚflagsÚ	__class__s         €Ú^/var/www/html/gaurav/venv/lib/python3.13/site-packages/sqlalchemy/dialects/mysql/expression.pyr)   Úmatch.__init__P   s  ø€ ÞÜ×#Ò#Ð$:Ó;Ð;à—&‘&˜ DÓ)ˆà‰?Ü×#Ò#Ð$9Ó:Ð:Ü×"Ò"Ü×'Ñ'Øó
ˆô
 ×)Ñ)×8Ñ8Ü×ÑØð 9ð 
ˆð ˆŒ
ä×"Ò"à&(§f¡fÐ->ÀÓ&FØ*,¯&©&Ø.°ó+ð *,¯©Ð0FÈÓ)Nñó
ˆö Ü×#Ò#Ð$;¸t¿y¹yÈ»}Ñ$MÓNÐNä‰Ñ˜¬	×(:Ñ(:ÀeÐÒLó    c                óJ   • U R                   R                  SS05      U l         U $ )zŠApply the "IN BOOLEAN MODE" modifier to the MATCH expression.

:return: a new :class:`_mysql.match` instance with modifications
 applied.
r   T©r   Úunion©r+   s    r1   r   Úmatch.in_boolean_moder   s%   € ð Ÿ™×-Ñ-Ð/CÀTÐ.JÓKˆŒØˆr3   c                óJ   • U R                   R                  SS05      U l         U $ )z“Apply the "IN NATURAL LANGUAGE MODE" modifier to the MATCH
expression.

:return: a new :class:`_mysql.match` instance with modifications
 applied.
r   Tr5   r7   s    r1   r   Úmatch.in_natural_language_mode}   s%   € ð Ÿ™×-Ñ-Ð/GÈÐ.NÓOˆŒØˆr3   c                óJ   • U R                   R                  SS05      U l         U $ )z�Apply the "WITH QUERY EXPANSION" modifier to the MATCH expression.

:return: a new :class:`_mysql.match` instance with modifications
 applied.
r   Tr5   r7   s    r1   r   Úmatch.with_query_expansion‰   s%   € ð Ÿ™×-Ñ-Ð/FÈÐ.MÓNˆŒØˆr3   r   )r,   zelements.ColumnElement[Any]r-   r   )Úreturnr   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__visit_name__Úinherit_cacheÚ__annotations__r)   r   r   r   r   Ú__static_attributes__Ú__classcell__)r0   s   @r1   r   r      s^   ø‡ ñ1ðf #€Nà€MØ+Ó+÷ MðD óó ðð ó	ó ð	ð óó ör3   r   N)Ú
__future__r   Útypingr   Ú r   r   Úsqlr   r	   r
   r   Úsql.baser   r   Úutil.typingr   ÚBinaryExpressionr   © r3   r1   Ú<module>rP      sC   ðõ #å å Ý Ý Ý Ý Ý Ý #Ý "Ý ô{ˆJ˜×1Ñ1°#Ñ6õ {r3   