%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/
Upload File :
Create Path :
Current File : //opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyo

�
��4]c@s(ddlmZddlmZddlmZddlmZddlmZyddl	m
ZWnek
r}dZnXejd	�Zejd
�Zdejfd��YZejd
dd�Zejddd�Zejddd�Zdejfd��YZeeej<eed<dS(i(tcolspecs(t
ischema_namesi(ttypes(t
expression(t	operatorsi����(tUUIDcCs|j||�S(s�A synonym for the :meth:`.ARRAY.Comparator.any` method.

    This method is legacy and is here for backwards-compatibility.

    .. seealso::

        :func:`.expression.any_`

    (tany(tothertarrexprtoperator((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pytAnyscCs|j||�S(s�A synonym for the :meth:`.ARRAY.Comparator.all` method.

    This method is legacy and is here for backwards-compatibility.

    .. seealso::

        :func:`.expression.all_`

    (tall(RRR	((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pytAll#starraycBs8eZdZdZd�Zedd�Zdd�ZRS(s�A PostgreSQL ARRAY literal.

    This is used to produce ARRAY literals in SQL expressions, e.g.::

        from sqlalchemy.dialects.postgresql import array
        from sqlalchemy.dialects import postgresql
        from sqlalchemy import select, func

        stmt = select([
                        array([1,2]) + array([3,4,5])
                    ])

        print(stmt.compile(dialect=postgresql.dialect()))

    Produces the SQL::

        SELECT ARRAY[%(param_1)s, %(param_2)s] ||
            ARRAY[%(param_3)s, %(param_4)s, %(param_5)s]) AS anon_1

    An instance of :class:`.array` will always have the datatype
    :class:`.ARRAY`.  The "inner" type of the array is inferred from
    the values present, unless the ``type_`` keyword argument is passed::

        array(['foo', 'bar'], type_=CHAR)

    Multidimensional arrays are produced by nesting :class:`.array` constructs.
    The dimensionality of the final :class:`.ARRAY` type is calculated by
    recursively adding the dimensions of the inner :class:`.ARRAY` type::

        stmt = select([
            array([
                array([1, 2]), array([3, 4]), array([column('q'), column('x')])
            ])
        ])
        print(stmt.compile(dialect=postgresql.dialect()))

    Produces::

        SELECT ARRAY[ARRAY[%(param_1)s, %(param_2)s],
        ARRAY[%(param_3)s, %(param_4)s], ARRAY[q, x]] AS anon_1

    .. versionadded:: 1.3.6 added support for multidimensional array literals

    .. seealso::

        :class:`.postgresql.ARRAY`

    R
cKs�tt|�j||�t|jt�rkt|jjd|jjdk	r\|jjdnd�|_nt|j�|_dS(Nt
dimensionsii(	tsuperR
t__init__t
isinstancettypetARRAYt	item_typeRtNone(tselftclausestkw((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyRfs"cCsy|s|tjkr@tjd|d|d|d|jdt�Stg|D]$}|j||dtd|�^qJ�SdS(Nt_compared_to_operatorttype_t_compared_to_typetuniquet_assume_scalar(	RtgetitemRt
BindParameterRRtTrueR
t_bind_param(RR	tobjRRto((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyR!rs	cCs3|tjtjtjfkr+tj|�S|SdS(N(Rtany_optall_opRRtGrouping(Rtagainst((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyt
self_group�s
N(	t__name__t
__module__t__doc__t__visit_name__RtFalseRR!R((((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyR
1s
1	s@>t
precedenceis<@s&&RcBs�eZdZdejjfd��YZeZed
ed�Z	e
d��Ze
d��Zd�Z
d�Zd�Zd	�ZRS(s�PostgreSQL ARRAY type.

    .. versionchanged:: 1.1 The :class:`.postgresql.ARRAY` type is now
       a subclass of the core :class:`.types.ARRAY` type.

    The :class:`.postgresql.ARRAY` type is constructed in the same way
    as the core :class:`.types.ARRAY` type; a member type is required, and a
    number of dimensions is recommended if the type is to be used for more
    than one dimension::

        from sqlalchemy.dialects import postgresql

        mytable = Table("mytable", metadata,
                Column("data", postgresql.ARRAY(Integer, dimensions=2))
            )

    The :class:`.postgresql.ARRAY` type provides all operations defined on the
    core :class:`.types.ARRAY` type, including support for "dimensions",
    indexed access, and simple matching such as
    :meth:`.types.ARRAY.Comparator.any` and
    :meth:`.types.ARRAY.Comparator.all`.  :class:`.postgresql.ARRAY` class also
    provides PostgreSQL-specific methods for containment operations, including
    :meth:`.postgresql.ARRAY.Comparator.contains`
    :meth:`.postgresql.ARRAY.Comparator.contained_by`, and
    :meth:`.postgresql.ARRAY.Comparator.overlap`, e.g.::

        mytable.c.data.contains([1, 2])

    The :class:`.postgresql.ARRAY` type may not be supported on all
    PostgreSQL DBAPIs; it is currently known to work on psycopg2 only.

    Additionally, the :class:`.postgresql.ARRAY` type does not work directly in
    conjunction with the :class:`.ENUM` type.  For a workaround, see the
    special type at :ref:`postgresql_array_of_enum`.

    .. seealso::

        :class:`.types.ARRAY` - base array type

        :class:`.postgresql.array` - produces a literal array value.

    t
ComparatorcBs)eZdZd�Zd�Zd�ZRS(s$Define comparison operations for :class:`.ARRAY`.

        Note that these operations are in addition to those provided
        by the base :class:`.types.ARRAY.Comparator` class, including
        :meth:`.types.ARRAY.Comparator.any` and
        :meth:`.types.ARRAY.Comparator.all`.

        cKs|jt|dtj�S(sBoolean expression.  Test if elements are a superset of the
            elements of the argument array expression.
            tresult_type(toperatetCONTAINStsqltypestBoolean(RRtkwargs((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pytcontains�scCs|jt|dtj�S(s�Boolean expression.  Test if elements are a proper subset of the
            elements of the argument array expression.
            R0(R1tCONTAINED_BYR3R4(RR((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pytcontained_by�scCs|jt|dtj�S(suBoolean expression.  Test if array has elements in common with
            an argument array expression.
            R0(R1tOVERLAPR3R4(RR((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pytoverlap�s(R)R*R+R6R8R:(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyR/�s			cCsat|t�rtd��nt|t�r9|�}n||_||_||_||_dS(sPConstruct an ARRAY.

        E.g.::

          Column('myarray', ARRAY(Integer))

        Arguments are:

        :param item_type: The data type of items of this array. Note that
          dimensionality is irrelevant here, so multi-dimensional arrays like
          ``INTEGER[][]``, are constructed as ``ARRAY(Integer)``, not as
          ``ARRAY(ARRAY(Integer))`` or such.

        :param as_tuple=False: Specify whether return results
          should be converted to tuples from lists. DBAPIs such
          as psycopg2 return lists by default. When tuples are
          returned, the results are hashable.

        :param dimensions: if non-None, the ARRAY will assume a fixed
         number of dimensions.  This will cause the DDL emitted for this
         ARRAY to include the exact number of bracket clauses ``[]``,
         and will also optimize the performance of the type overall.
         Note that PG arrays are always implicitly "non-dimensioned",
         meaning they can store any number of dimensions no matter how
         they were declared.

        :param zero_indexes=False: when True, index values will be converted
         between Python zero-based and PostgreSQL one-based indexes, e.g.
         a value of one will be added to all index values before passing
         to the database.

         .. versionadded:: 0.9.5


        sUDo not nest ARRAY types; ARRAY(basetype) handles multi-dimensional arrays of basetypeN(RRt
ValueErrorRRtas_tupleRtzero_indexes(RRR<RR=((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyR�s&			cCs|jS(N(R<(R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pythashablescCstS(N(tlist(R((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pytpython_typescCs
||kS(N((Rtxty((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pytcompare_values scs��dkrt|�}n�dksT�dkr�|sTt|dttf�r��rt��fd�|D��S�|�Sn#�����fd�|D��SdS(Niic3s|]}�|�VqdS(N((t.0RA(titemproc(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pys	<genexpr>2sc3s=|]3}�j|��dk	r+�dnd��VqdS(iN(t_proc_arrayR(RDRA(t
collectiontdimRER(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pys	<genexpr>7s(RR?Rttuple(RtarrRERHRG((RGRHRERsW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyRF#s
cs1�jj|�j|����fd�}|S(Ncs-|dkr|S�j|��jt�SdS(N(RRFRR?(tvalue(t	item_procR(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pytprocessEs(Rtdialect_impltbind_processor(RtdialectRM((RLRsW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyRO@s	cs4�jj|�j||����fd�}|S(Ncs<|dkr|S�j|��j�jr1tnt�SdS(N(RRFRR<RIR?(RK(RLR(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyRMTs(RRNtresult_processor(RRPtcoltypeRM((RLRsW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyRQOsN(R)R*R+R3RR/tcomparator_factoryR-RRtpropertyR>R@RCRFRORQ(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyR�s+1			t_arrayN(tbaseRRtRR3tsqlRRtuuidRt_python_UUIDtImportErrorRteqR
RtTupleR
t	custom_opR2R7R9R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyt<module>s"

`�


Zerion Mini Shell 1.0