403Webshell
Server IP : 192.158.238.246  /  Your IP : 3.19.244.133
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/sql/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/sql/__pycache__/functions.cpython-37.pyc
B

��4]��@sdZddlmZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
dd	lmZdd
lm
Z
ddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZe� e!�Z"e� dd��Z#ej$ddd �Z%dwd"d#�Z&Gd$d%�d%e
ee�Z'Gd&d'�d'e�Z(Gd(d)�d)e)�Z*e*�Z+e*d*d+�Z,Gd,d-�d-e'�Z-Gd.d/�d/e�Z.Gd0d1�d1e�/e.e-��Z0e&d2e�e&d3e�Gd4d5�d5e0�Z1Gd6d7�d7e0�Z2Gd8d9�d9e0�Z3Gd:d;�d;e3�Z4Gd<d=�d=e3�Z5Gd>d?�d?e3�Z6Gd@dA�dAe3�Z7GdBdC�dCe0�Z8GdDdE�dEe0�Z9GdFdG�dGe0�Z:GdHdI�dIe0�Z;GdJdK�dKe0�Z<GdLdM�dMe2�Z=GdNdO�dOe2�Z>GdPdQ�dQe2�Z?GdRdS�dSe2�Z@GdTdU�dUe2�ZAGdVdW�dWe2�ZBGdXdY�dYe2�ZCGdZd[�d[e2�ZDGd\d]�d]e2�ZEGd^d_�d_e0�ZFGd`da�dae0�ZGGdbdc�dceG�ZHGddde�deeG�ZIGdfdg�dgeG�ZJGdhdi�die0�ZKGdjdk�dke0�ZLGdldm�dme0�ZMGdndo�doe0�ZNGdpdq�dqe0�ZOGdrds�dse0�ZPGdtdu�due0�ZQdvS)xz6SQL function API, factories, and built-in functions.

�)�
annotation)�	operators)�schema)�sqltypes)�util)�ColumnCollection)�
Executable)�_clone)�_literal_as_binds)�_type_from_args)�BinaryExpression)�
BindParameter)�Cast)�
ClauseList)�
ColumnElement)�Extract)�FunctionFilter)�Grouping)�literal_column)�Over)�WithinGroup)�Alias)�
FromClause)�Select)�
VisitableType�cCs
t�t�S)N)r�defaultdict�dict�rr�K/opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/sql/functions.py�<lambda>(�r Zcase_sensitive_functionzHSymbol to mark the functions that are switched into case-sensitive mode.)�name�doc�_defaultcCs�t|}t|}|}|��}||kr�||tk	r�|||krVt�d�|��|||<q�t�d�|t||�	��d��t||<nN||kr�|||kr�t�d�t
||�	��|��q�t�d�|��n|||<||||<dS)z�Associate a callable with a particular func. name.

    This is normally called by _GenericMeta, but is also
    available by itself so that a non-Function construct
    can be associated with the :data:`.func` accessor (i.e.
    CAST, EXTRACT).

    zLThe GenericFunction '{}' is already registered and is going to be overriden.z�GenericFunction '{}' is already registered with different letter case, so the previously registered function '{}' is switched into case-sensitive mode. GenericFunction objects will be fully case-insensitive in a future release.�z�GenericFunction(s) '{}' are already registered with different letter cases and might interact with '{}'. GenericFunction objects will be fully case-insensitive in a future release.N)�	_registry�_case_sensitive_registry�lower�_CASE_SENSITIVEr�warn�formatZwarn_deprecated�list�keys�sorted)�
identifier�fn�packageZreg�case_sensitive_regZraw_identifierrrr�register_function0s4	



r3cs�eZdZdZdZdZdd�Zdd�Zedd	��Z	e
jd
d��Zd)d
d�Z
dd�Zdd�Zdd�Zedd��Zdd�Zefdd�Zdd�Zd*dd�Zdd �Zd!d"�Zd#d$�Zd+d%d&�Zd,�fd'd(�	Z�ZS)-�FunctionElementa<Base for SQL function-oriented constructs.

    .. seealso::

        :class:`.Function` - named SQL function.

        :data:`.func` - namespace which produces registered or ad-hoc
        :class:`.Function` instances.

        :class:`.GenericFunction` - allows creation of registered function
        types.

    rFcs>�fdd�|D�}�jpt|��_t|tjdd�����_dS)z/Construct a :class:`.FunctionElement`.
        csg|]}t|�j��qSr)r
r")�.0�c)�selfrr�
<listcomp>�sz,FunctionElement.__init__.<locals>.<listcomp>T)�operator�group_contentsN)�	_has_args�boolrr�comma_op�
self_group�clause_expr)r7�clauses�kwargs�argsr)r7r�__init__�szFunctionElement.__init__cCs|�|||�S)N)Z_execute_function)r7Z
connectionZmultiparams�paramsrrr�_execute_on_connection�sz&FunctionElement._execute_on_connectioncCst|�d��S)a2The set of columns exported by this :class:`.FunctionElement`.

        Function objects currently have no result column names built in;
        this method returns a single-element column collection with
        an anonymously named column.

        An interim approach to providing named columns for a function
        as a FROM clause is to build a :func:`.select` with the
        desired columns::

            from sqlalchemy.sql import column

            stmt = select([column('x'), column('y')]).                select_from(func.myfunction())


        N)r�label)r7rrr�columns�szFunctionElement.columnscCs|jjS)z}Return the underlying :class:`.ClauseList` which contains
        the arguments for this :class:`.FunctionElement`.

        )r?�element)r7rrrr@�szFunctionElement.clausesNcCst|||||d�S)a�Produce an OVER clause against this function.

        Used against aggregate or so-called "window" functions,
        for database backends that support window functions.

        The expression::

            func.row_number().over(order_by='x')

        is shorthand for::

            from sqlalchemy import over
            over(func.row_number(), order_by='x')

        See :func:`~.expression.over` for a full description.

        )�partition_by�order_by�rows�range_)r)r7rIrJrKrLrrr�over�szFunctionElement.overcGst|f|��S)ayProduce a WITHIN GROUP (ORDER BY expr) clause against this function.

        Used against so-called "ordered set aggregate" and "hypothetical
        set aggregate" functions, including :class:`.percentile_cont`,
        :class:`.rank`, :class:`.dense_rank`, etc.

        See :func:`~.expression.within_group` for a full description.

        .. versionadded:: 1.1


        )r)r7rJrrr�within_group�s
zFunctionElement.within_groupcGs|s|St|f|��S)a�Produce a FILTER clause against this function.

        Used against aggregate and window functions,
        for database backends that support the "FILTER" clause.

        The expression::

            func.count(1).filter(True)

        is shorthand for::

            from sqlalchemy import funcfilter
            funcfilter(func.count(1), True)

        .. versionadded:: 1.0.0

        .. seealso::

            :class:`.FunctionFilter`

            :func:`.funcfilter`


        )r)r7Z	criterionrrr�filter�szFunctionElement.filtercCst|||�S)a^
Interpret this expression as a boolean comparison between two values.

        A hypothetical SQL function "is_equal()" which compares to values
        for equality would be written in the Core expression language as::

            expr = func.is_equal("a", "b")

        If "is_equal()" above is comparing "a" and "b" for equality, the
        :meth:`.FunctionElement.as_comparison` method would be invoked as::

            expr = func.is_equal("a", "b").as_comparison(1, 2)

        Where above, the integer value "1" refers to the first argument of the
        "is_equal()" function and the integer value "2" refers to the second.

        This would create a :class:`.BinaryExpression` that is equivalent to::

            BinaryExpression("a", "b", operator=op.eq)

        However, at the SQL level it would still render as
        "is_equal('a', 'b')".

        The ORM, when it loads a related object or collection, needs to be able
        to manipulate the "left" and "right" sides of the ON clause of a JOIN
        expression. The purpose of this method is to provide a SQL function
        construct that can also supply this information to the ORM, when used
        with the :paramref:`.relationship.primaryjoin` parameter.  The return
        value is a containment object called :class:`.FunctionAsBinary`.

        An ORM example is as follows::

            class Venue(Base):
                __tablename__ = 'venue'
                id = Column(Integer, primary_key=True)
                name = Column(String)

                descendants = relationship(
                    "Venue",
                    primaryjoin=func.instr(
                        remote(foreign(name)), name + "/"
                    ).as_comparison(1, 2) == 1,
                    viewonly=True,
                    order_by=name
                )

        Above, the "Venue" class can load descendant "Venue" objects by
        determining if the name of the parent Venue is contained within the
        start of the hypothetical descendant value's name, e.g. "parent1" would
        match up to "parent1/child1", but not to "parent2/child1".

        Possible use cases include the "materialized path" example given above,
        as well as making use of special SQL functions such as geometric
        functions to create join conditions.

        :param left_index: the integer 1-based index of the function argument
         that serves as the "left" side of the expression.
        :param right_index: the integer 1-based index of the function argument
         that serves as the "right" side of the expression.

        .. versionadded:: 1.3

        )�FunctionAsBinary)r7�
left_index�right_indexrrr�
as_comparison�s?zFunctionElement.as_comparisoncCs|jjS)N)r@�
_from_objects)r7rrrrT5szFunctionElement._from_objectscKs|jfS)N)r?)r7rArrr�get_children9szFunctionElement.get_childrencKs(||jf|�|_|��tj�|�dS)N)r?Z_reset_exportedr4r@Z_reset)r7�clone�kwrrr�_copy_internals<szFunctionElement._copy_internalscCsdS)aFor types that define their return type as based on the criteria
        within a WITHIN GROUP (ORDER BY) expression, called by the
        :class:`.WithinGroup` construct.

        Returns None by default, in which case the function's normal ``.type``
        is used.

        Nr)r7rNrrr�within_group_typeAs
z!FunctionElement.within_group_typecCst�||�S)a_Produce a :class:`.Alias` construct against this
        :class:`.FunctionElement`.

        This construct wraps the function in a named alias which
        is suitable for the FROM clause, in the style accepted for example
        by PostgreSQL.

        e.g.::

            from sqlalchemy.sql import column

            stmt = select([column('data_view')]).\
                select_from(SomeTable).\
                select_from(func.unnest(SomeTable.data).alias('data_view')
            )

        Would produce:

        .. sourcecode:: sql

            SELECT data_view
            FROM sometable, unnest(sometable.data) AS data_view

        .. versionadded:: 0.9.8 The :meth:`.FunctionElement.alias` method
           is now supported.  Previously, this method's behavior was
           undefined and did not behave consistently across versions.

        )rZ
_construct)r7r"Zflatrrr�aliasMszFunctionElement.aliascCs"t|g�}|jr|jf|j�}|S)z�Produce a :func:`~.expression.select` construct
        against this :class:`.FunctionElement`.

        This is shorthand for::

            s = select([function_element])

        )rZ_execution_optionsZexecution_options)r7�srrr�selectms	
zFunctionElement.selectcCs|������S)arExecute this :class:`.FunctionElement` against an embedded
        'bind' and return a scalar value.

        This first calls :meth:`~.FunctionElement.select` to
        produce a SELECT construct.

        Note that :class:`.FunctionElement` can be passed to
        the :meth:`.Connectable.scalar` method of :class:`.Connection`
        or :class:`.Engine`.

        )r\�execute�scalar)r7rrrr^{szFunctionElement.scalarcCs|����S)aYExecute this :class:`.FunctionElement` against an embedded
        'bind'.

        This first calls :meth:`~.FunctionElement.select` to
        produce a SELECT construct.

        Note that :class:`.FunctionElement` can be passed to
        the :meth:`.Connectable.execute` method of :class:`.Connection`
        or :class:`.Engine`.

        )r\r])r7rrrr]�szFunctionElement.executecCstd|||jd|d�S)NT)�_compared_to_operator�_compared_to_type�unique�type_)r
�type)r7r9�objrbrrr�_bind_param�szFunctionElement._bind_paramcs6|tjkr t|jtj�r t|�Stt|�j	|d�SdS)N)�against)
r�getitem�
isinstancercr�ARRAYr�superr4r>)r7rf)�	__class__rrr>�szFunctionElement.self_group)NNNN)NF)N)N)�__name__�
__module__�__qualname__�__doc__�packagenamesr;rCrE�propertyrGrZmemoized_propertyr@rMrNrOrSrTrUr	rXrYrZr\r^r]rer>�
__classcell__rr)rkrr4rs*
	
A
 

r4cs\eZdZ�fdd�Zedd��Zejdd��Zedd��Zejdd��Z�fd	d
�Z�Z	S)rPcsR|jj|d}|jj|d}||_||_||_tt|�j||tjt	j
d�dS)Nr)rb)r@�sql_functionrQrRrjrPrCrZfunction_as_comparison_oprZBOOLEANTYPE)r7r0rQrR�left�right)rkrrrC�s
zFunctionAsBinary.__init__cCs|jjj|jdS)Nr)rsr@rQ)r7rrrrt�szFunctionAsBinary.leftcCs||jjj|jd<dS)Nr)rsr@rQ)r7�valuerrrrt�scCs|jjj|jdS)Nr)rsr@rR)r7rrrru�szFunctionAsBinary.rightcCs||jjj|jd<dS)Nr)rsr@rR)r7rvrrrru�scs0|�d�}||jf|�|_tt|�jf|�dS)NrV)�poprsrjrPrX)r7rWrV)rkrrrX�s
z FunctionAsBinary._copy_internals)
rlrmrnrCrqrt�setterrurXrrrr)rkrrP�srPc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_FunctionGeneratorz;Generate :class:`.Function` objects based on getattr calls.cKsg|_||_dS)N)�_FunctionGenerator__names�opts)r7r{rrrrC�sz_FunctionGenerator.__init__cCsl|�d�r4y
|j|Stk
r0t|��YqJXn|�d�rJ|dd�}tf|j�}t|j�|g|_|S)N�__�_r%���)	�
startswith�__dict__�KeyError�AttributeError�endswithryr{r,rz)r7r"�frrr�__getattr__�s


z_FunctionGenerator.__getattr__c	Os�|j��}|�|�t|j�}|dkr2|j\}}n|dkrLd|jd}}nd}|dk	r�t|�|���}|tkr�t	|}|�|����|�}|dk	r�|||�St
|jdf|�d|jdd�i|��S)Nrrr$r%r~rp)r{�copy�update�lenrzr&�getr(r)r'�Function)	r7r6rA�o�tokensr1�fname�funcr2rrr�__call__�s"



z_FunctionGenerator.__call__N)rlrmrnrorCr�r�rrrrry�sryF)�groupc@s&eZdZdZdZdd�Zddd�ZdS)	r�aYDescribe a named SQL function.

    See the superclass :class:`.FunctionElement` for a description
    of public methods.

    .. seealso::

        :data:`.func` - namespace which produces registered or ad-hoc
        :class:`.Function` instances.

        :class:`.GenericFunction` - allows creation of registered function
        types.

    �functioncOsP|�dd�pg|_||_|�dd�|_t�|�dd��|_tj	|f|�|�dS)z�Construct a :class:`.Function`.

        The :data:`.func` construct is normally used to construct
        new :class:`.Function` instances.

        rpN�bindrb)
rwrpr"r��_bindr�to_instancercr4rC)r7r"r@rWrrrrC_s
zFunction.__init__NcCst|j|||j|dd�S)NT)r_r`rbra)r
r"rc)r7r9rdrbrrrremszFunction._bind_param)N)rlrmrnroZ__visit_name__rCrerrrrr�Msr�cseZdZ�fdd�Z�ZS)�_GenericMetacs�tj|jkrv|�d|�|_}|�d|�|_}|�dd�}d|krN|d|_t|dd�|_	|j	rpt
|||�nd|_	tt|��
|||�dS)Nr"r/r1r$Z__return_type__�	_registerT)rZ	Annotated�__mro__r�r"r/rwrc�getattrr�r3rjr�rC)�clsZclsname�basesZclsdictr"r/r1)rkrrrCys
z_GenericMeta.__init__)rlrmrnrCrrrr)rkrr�xsr�c@s eZdZdZdZdZdd�ZdS)�GenericFunctiona�Define a 'generic' function.

    A generic function is a pre-established :class:`.Function`
    class that is instantiated automatically when called
    by name from the :data:`.func` attribute.    Note that
    calling any name from :data:`.func` has the effect that
    a new :class:`.Function` instance is created automatically,
    given that name.  The primary use case for defining
    a :class:`.GenericFunction` class is so that a function
    of a particular name may be given a fixed return type.
    It can also include custom argument parsing schemes as well
    as additional methods.

    Subclasses of :class:`.GenericFunction` are automatically
    registered under the name of the class.  For
    example, a user-defined function ``as_utc()`` would
    be available immediately::

        from sqlalchemy.sql.functions import GenericFunction
        from sqlalchemy.types import DateTime

        class as_utc(GenericFunction):
            type = DateTime

        print select([func.as_utc()])

    User-defined generic functions can be organized into
    packages by specifying the "package" attribute when defining
    :class:`.GenericFunction`.   Third party libraries
    containing many functions may want to use this in order
    to avoid name conflicts with other systems.   For example,
    if our ``as_utc()`` function were part of a package
    "time"::

        class as_utc(GenericFunction):
            type = DateTime
            package = "time"

    The above function would be available from :data:`.func`
    using the package name ``time``::

        print select([func.time.as_utc()])

    A final option is to allow the function to be accessed
    from one name in :data:`.func` but to render as a different name.
    The ``identifier`` attribute will override the name used to
    access the function as loaded from :data:`.func`, but will retain
    the usage of ``name`` as the rendered name::

        class GeoBuffer(GenericFunction):
            type = Geometry
            package = "geo"
            name = "ST_Buffer"
            identifier = "buffer"

    The above function will render as follows::

        >>> print func.geo.buffer()
        ST_Buffer()

    TFcs�|�dd�}|dkr&�fdd�|D�}�jp2t|��_g�_|�dd��_t|tjdd���	��_
t�|�dd�p|t
�dd���_dS)	N�_parsed_argscsg|]}t|�j��qSr)r
r")r5r6)r7rrr8�sz,GenericFunction.__init__.<locals>.<listcomp>r�T)r9r:rbrc)rwr;r<rpr�r�rrr=r>r?rr�r�rc)r7rBrAZparsed_argsr)r7rrC�szGenericFunction.__init__N)rlrmrnroZcoerce_argumentsr�rCrrrrr��s=r��cast�extractc@s0eZdZdZe��ZdZdd�Ze	dd��Z
dS)�
next_valueaRepresent the 'next value', given a :class:`.Sequence`
    as its single argument.

    Compiles into the appropriate function on each backend,
    or will raise NotImplementedError if used on a backend
    that does not provide support for sequences.

    cKs,t|tj�std��|�dd�|_||_dS)Nz0next_value() accepts a Sequence object as input.r�)rhr�Sequence�AssertionErrorr�r��sequence)r7�seqrWrrrrC�s
znext_value.__init__cCsgS)Nr)r7rrrrT�sznext_value._from_objectsN)rlrmrnror�Integerrcr"rCrqrTrrrrr��s
r�c@seZdZdd�ZdS)�AnsiFunctioncOstj|f|�|�dS)N)r�rC)r7rBrArrrrC�szAnsiFunction.__init__N)rlrmrnrCrrrrr��sr�cs eZdZdZ�fdd�Z�ZS)�ReturnTypeFromArgszADefine a function whose return type is the same as its arguments.cs@�fdd�|D�}|�dt|��||d<tt��j||�dS)Ncsg|]}t|�j��qSr)r
r")r5r6)r7rrr8sz/ReturnTypeFromArgs.__init__.<locals>.<listcomp>rbr�)�
setdefaultrrjr�rC)r7rBrA)rk)r7rrCszReturnTypeFromArgs.__init__)rlrmrnrorCrrrr)rkrr�sr�c@seZdZdZdS)�coalesceTN)rlrmrnr;rrrrr�sr�c@seZdZdS)�maxN)rlrmrnrrrrr�sr�c@seZdZdS)�minN)rlrmrnrrrrr�sr�c@seZdZdS)�sumN)rlrmrnrrrrr�sr�c@seZdZejZdS)�nowN)rlrmrnr�DateTimercrrrrr�sr�c@seZdZejZdS)�concatN)rlrmrnr�Stringrcrrrrr� sr�c@seZdZejZdd�ZdS)�char_lengthcKstj||f|�dS)N)r�rC)r7�argrArrrrC'szchar_length.__init__N)rlrmrnrr�rcrCrrrrr�$sr�c@seZdZdZdS)�randomTN)rlrmrnr;rrrrr�+sr�cs(eZdZdZejZd�fdd�	Z�ZS)�counta�The ANSI COUNT aggregate function.  With no arguments,
    emits COUNT \*.

    E.g.::

        from sqlalchemy import func
        from sqlalchemy import select
        from sqlalchemy import table, column

        my_table = table('some_table', column('id'))

        stmt = select([func.count()]).select_from(my_table)

    Executing ``stmt`` would emit::

        SELECT count(*) AS count_1
        FROM some_table


    Ncs(|dkrtd�}tt|�j|f|�dS)N�*)rrjr�rC)r7Z
expressionrA)rkrrrCFszcount.__init__)N)	rlrmrnrorr�rcrCrrrr)rkrr�/sr�c@seZdZejZdS)�current_dateN)rlrmrnrZDatercrrrrr�Lsr�c@seZdZejZdS)�current_timeN)rlrmrnrZTimercrrrrr�Psr�c@seZdZejZdS)�current_timestampN)rlrmrnrr�rcrrrrr�Tsr�c@seZdZejZdS)�current_userN)rlrmrnrr�rcrrrrr�Xsr�c@seZdZejZdS)�	localtimeN)rlrmrnrr�rcrrrrr�\sr�c@seZdZejZdS)�localtimestampN)rlrmrnrr�rcrrrrr�`sr�c@seZdZejZdS)�session_userN)rlrmrnrr�rcrrrrr�dsr�c@seZdZejZdS)�sysdateN)rlrmrnrr�rcrrrrr�hsr�c@seZdZejZdS)�userN)rlrmrnrr�rcrrrrr�lsr�cs&eZdZdZejZ�fdd�Z�ZS)�	array_agga�support for the ARRAY_AGG function.

    The ``func.array_agg(expr)`` construct returns an expression of
    type :class:`.types.ARRAY`.

    e.g.::

        stmt = select([func.array_agg(table.c.values)[2:5]])

    .. versionadded:: 1.1

    .. seealso::

        :func:`.postgresql.array_agg` - PostgreSQL-specific version that
        returns :class:`.postgresql.ARRAY`, which has PG-specific operators
        added.

    csldd�|D�}|�dtj�}d|krNt|�}t|tj�rB||d<n||�|d<||d<tt|�j||�dS)NcSsg|]}t|��qSr)r
)r5r6rrrr8�sz&array_agg.__init__.<locals>.<listcomp>Z_default_array_typerbr�)rwrrirrhrjr�rC)r7rBrAZdefault_array_typeZtype_from_args)rkrrrC�s
zarray_agg.__init__)	rlrmrnrorrircrCrrrr)rkrr�psr�c@seZdZdZdZdd�ZdS)�
OrderedSetAggz�Define a function where the return type is based on the sort
    expression type as defined by the expression passed to the
    :meth:`.FunctionElement.within_group` method.FcCsF|jj}t�|j�}|jr8t|j�dkr8t�	|dj
�S|dj
SdS)Nrr%)r?rH�sqlutilZunwrap_order_byrJ�array_for_multi_clauser�r@rrirc)r7rNZfunc_clausesrJrrrrY�s
zOrderedSetAgg.within_group_typeN)rlrmrnror�rYrrrrr��sr�c@seZdZdZdS)�modea*implement the ``mode`` ordered-set aggregate function.

    This function must be used with the :meth:`.FunctionElement.within_group`
    modifier to supply a sort expression to operate upon.

    The return type of this function is the same as the sort expression.

    .. versionadded:: 1.1

    N)rlrmrnrorrrrr��s
r�c@seZdZdZdZdS)�percentile_conta�implement the ``percentile_cont`` ordered-set aggregate function.

    This function must be used with the :meth:`.FunctionElement.within_group`
    modifier to supply a sort expression to operate upon.

    The return type of this function is the same as the sort expression,
    or if the arguments are an array, an :class:`.types.ARRAY` of the sort
    expression's type.

    .. versionadded:: 1.1

    TN)rlrmrnror�rrrrr��sr�c@seZdZdZdZdS)�percentile_disca�implement the ``percentile_disc`` ordered-set aggregate function.

    This function must be used with the :meth:`.FunctionElement.within_group`
    modifier to supply a sort expression to operate upon.

    The return type of this function is the same as the sort expression,
    or if the arguments are an array, an :class:`.types.ARRAY` of the sort
    expression's type.

    .. versionadded:: 1.1

    TN)rlrmrnror�rrrrr��sr�c@seZdZdZe��ZdS)�ranka!Implement the ``rank`` hypothetical-set aggregate function.

    This function must be used with the :meth:`.FunctionElement.within_group`
    modifier to supply a sort expression to operate upon.

    The return type of this function is :class:`.Integer`.

    .. versionadded:: 1.1

    N)rlrmrnrorr�rcrrrrr��s
r�c@seZdZdZe��ZdS)�
dense_ranka'Implement the ``dense_rank`` hypothetical-set aggregate function.

    This function must be used with the :meth:`.FunctionElement.within_group`
    modifier to supply a sort expression to operate upon.

    The return type of this function is :class:`.Integer`.

    .. versionadded:: 1.1

    N)rlrmrnrorr�rcrrrrr��s
r�c@seZdZdZe��ZdS)�percent_ranka)Implement the ``percent_rank`` hypothetical-set aggregate function.

    This function must be used with the :meth:`.FunctionElement.within_group`
    modifier to supply a sort expression to operate upon.

    The return type of this function is :class:`.Numeric`.

    .. versionadded:: 1.1

    N)rlrmrnror�Numericrcrrrrr��s
r�c@seZdZdZe��ZdS)�	cume_dista&Implement the ``cume_dist`` hypothetical-set aggregate function.

    This function must be used with the :meth:`.FunctionElement.within_group`
    modifier to supply a sort expression to operate upon.

    The return type of this function is :class:`.Numeric`.

    .. versionadded:: 1.1

    N)rlrmrnrorr�rcrrrrr�s
r�c@seZdZdZdZdS)�cubeaNImplement the ``CUBE`` grouping operation.

    This function is used as part of the GROUP BY of a statement,
    e.g. :meth:`.Select.group_by`::

        stmt = select(
            [func.sum(table.c.value), table.c.col_1, table.c.col_2]
            ).group_by(func.cube(table.c.col_1, table.c.col_2))

    .. versionadded:: 1.2

    TN)rlrmrnror;rrrrr�sr�c@seZdZdZdZdS)�rollupaNImplement the ``ROLLUP`` grouping operation.

    This function is used as part of the GROUP BY of a statement,
    e.g. :meth:`.Select.group_by`::

        stmt = select(
            [func.sum(table.c.value), table.c.col_1, table.c.col_2]
        ).group_by(func.rollup(table.c.col_1, table.c.col_2))

    .. versionadded:: 1.2

    TN)rlrmrnror;rrrrr� sr�c@seZdZdZdZdS)�
grouping_setsa%Implement the ``GROUPING SETS`` grouping operation.

    This function is used as part of the GROUP BY of a statement,
    e.g. :meth:`.Select.group_by`::

        stmt = select(
            [func.sum(table.c.value), table.c.col_1, table.c.col_2]
        ).group_by(func.grouping_sets(table.c.col_1, table.c.col_2))

    In order to group by multiple sets, use the :func:`.tuple_` construct::

        from sqlalchemy import tuple_

        stmt = select(
            [
                func.sum(table.c.value),
                table.c.col_1, table.c.col_2,
                table.c.col_3]
        ).group_by(
            func.grouping_sets(
                tuple_(table.c.col_1, table.c.col_2),
                tuple_(table.c.value, table.c.col_3),
            )
        )


    .. versionadded:: 1.2

    TN)rlrmrnror;rrrrr�0sr�N)r$)Rro�rrrrrr��baserr�elementsr	r
rrr
rrrrrrrrrZ
selectablerrrZvisitorsrrrr&r'�symbolr)r3r4rP�objectryr��modifierr�r��with_metaclassr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr�<module>
s�

B>&0F
+Q


%


Youez - 2016 - github.com/yon3zu
LinuXploit