ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ 4]c@s(ddlmZddlmZddlmZddlmZddlmZyddl m Z Wne k r}dZ nXejd Zejd Zd ejfd YZejd ddZejdddZejdddZdejfdYZeeejt precedenceis<@s&&RcBseZdZdejjfdYZeZed edZ e dZ e dZ dZ dZdZd ZRS( sPostgreSQL 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)eZdZdZdZdZRS(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|dtjS(sBoolean expression. Test if elements are a superset of the elements of the argument array expression. t result_type(toperatetCONTAINStsqltypestBoolean(RRtkwargs((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pytcontainsscCs|jt|dtjS(sBoolean expression. Test if elements are a proper subset of the elements of the argument array expression. R2(R3t CONTAINED_BYR5R6(RR((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyt contained_byscCs|jt|dtjS(suBoolean expression. Test if array has elements in common with an argument array expression. R2(R3tOVERLAPR5R6(RR((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pytoverlaps(R+R,R-R8R:R<(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyR1s   cCsat|trtdnt|tr9|}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.pyRs&     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.pyt python_typescCs ||kS(N((Rtxty((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pytcompare_values scsdkrt|}ndksTdkr| sTt|dttf rrtfd|DS|Sn#fd|DSdS(Niic3s|]}|VqdS(N((t.0RC(titemproc(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pys 2sc3s=|]3}j|dk r+dndVqdS(iN(t _proc_arrayR(RFRC(t collectiontdimRGR(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pys 7s(RRARttuple(RtarrRGRJRI((RIRJRGRsW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyRH#s    cs1jj|j|fd}|S(Ncs-|dkr|Sj|jtSdS(N(RRHRRA(tvalue(t item_procR(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pytprocessEs (Rt dialect_impltbind_processor(RtdialectRO((RNRsW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyRQ@s cs4jj|j||fd}|S(Ncs<|dkr|Sj|jjr1tntSdS(N(RRHRR>RKRA(RM(RNR(sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyROTs (RRPtresult_processor(RRRtcoltypeRO((RNRsW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyRSOs  N(R+R,R-R5RR1tcomparator_factoryR/RRtpropertyR@RBRERHRQRS(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyRs+1   t_arrayN(tbaseRRtRR5tsqlRRtuuidRt _python_UUIDt ImportErrorRteqR R tTupleR t custom_opR4R9R;R(((sW/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.pyts"  `