/
opt
/
alt
/
python27
/
lib64
/
python2.7
/
site-packages
/
sqlalchemy
/
dialects
/
mysql
/
up file
home
� 1��fc @ s� d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d e e j f d � � YZ d S( i ( t exc( t util( t coercions( t elements( t operators( t roles( t _generative( t Generativet matchc B sP e Z d Z d Z e Z d � Z e d � � Z e d � � Z e d � � Z RS( s[ 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:: 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` t mysql_matchc O s | s t j d � � n | j d d � } | d k rH t j d � � n t j t j | � } t j j t j d | �} t | _ t j i | j d t � d 6| j d t � d 6| j d t � d 6� } | r� t j d d j | � � � n t t | � j | | t j d | �d S( Ns columns are requiredt againsts against is requiredt clausest in_boolean_modet mysql_boolean_modet in_natural_language_modet mysql_natural_languaget with_query_expansiont mysql_query_expansions unknown arguments: %ss , t modifiers( R t ArgumentErrort popt NoneR t expectR t ExpressionElementRoleR t BooleanClauseListt _construct_rawR t comma_opt Falset groupR t immutabledictt joint superR t __init__t match_op( t selft colst kwR t leftt flags( ( sW /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/mysql/expression.pyR G s, c C s | j j i t d 6� | _ d S( s� Apply the "IN BOOLEAN MODE" modifier to the MATCH expression. :return: a new :class:`_mysql.match` instance with modifications applied. R N( R t uniont True( R"