ó
    Ñ]jC  ã                  ól  • S SK Jr  S SK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KJr  SSKJr  SSKJr  SSKJr  SSKJr  \	(       aT  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K&J*r*  SS KJ+r+  SS!K,J-r-  \
" S"\S#9r.\
" S$\S#9r/\R`                  4       S,S% jjr\R`                  4       S,S& jjr1 " S' S(\Rd                  \.   5      r3 " S) S*\Rh                  \.   5      r4S-S+ jr5g).é    )ÚannotationsN)ÚAny)ÚIterable)ÚOptional)ÚSequence)ÚTYPE_CHECKING)ÚTypeVar)ÚUnioné   )ÚCONTAINED_BY)ÚCONTAINS)ÚOVERLAPé   )Útypes)Úutil)Ú
expression)Ú	operators)ÚInternalTraversal)ÚDialect)Ú_ColumnExpressionArgument)Ú_TypeEngineArgument)ÚColumnElement)ÚGrouping)ÚBindParameter)ÚOperatorType)Ú_SelectIterable)Ú_BindProcessorType)Ú_LiteralProcessorType)Ú_ResultProcessorType)Ú
TypeEngine)Ú_TraverseInternalsType)ÚSelfÚ_T)ÚboundÚ_CTc                ó$   • UR                  X5      $ )zbA synonym for the ARRAY-level :meth:`.ARRAY.Comparator.any` method.
See that method for details.

)Úany©ÚotherÚarrexprÚoperators      Úa/home/mande/repo/quber/.venv/lib/python3.13/site-packages/sqlalchemy/dialects/postgresql/array.pyr   r   2   ó   € ð �;‰;�uÓ'Ð'ó    c                ó$   • UR                  X5      $ )zbA synonym for the ARRAY-level :meth:`.ARRAY.Comparator.all` method.
See that method for details.

)Úallr(   s      r,   ÚAllr1   ?   r-   r.   c                  óÜ   ^ • \ rS rSr% SrS rSrS\R                  4S\R                  4/r
S\S'   SS	.     SU 4S
 jjjr\SS j5       r  S         SS jjr S   SS jjrSrU =r$ )ÚarrayéL   a  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:

.. sourcecode:: 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:`_types.ARRAY`.  The "inner" type of the array is inferred from the
values present, unless the :paramref:`_postgresql.array.type_` keyword
argument is passed::

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

When constructing an empty array, the :paramref:`_postgresql.array.type_`
argument is particularly important as PostgreSQL server typically requires
a cast to be rendered for the inner type in order to render an empty array.
SQLAlchemy's compilation for the empty array will produce this cast so
that::

    stmt = array([], type_=Integer)
    print(stmt.compile(dialect=postgresql.dialect()))

Produces:

.. sourcecode:: sql

    ARRAY[]::INTEGER[]

As required by PostgreSQL for empty arrays.

.. versionadded:: 2.0.40 added support to render empty PostgreSQL array
   literals with a required cast.

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

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

Produces:

.. sourcecode:: sql

    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`

Ú
postgresqlÚclausesÚtyper!   Ú_traverse_internalsN)Útype_c               ó~  >• [         TU ]  " [        R                  /UQ70 UD6  Ub  UO9U R                  (       a  U R                  S   R
                  O[        R                  n[        U[        5      (       a6  [        UR                  UR                  b  UR                  S-   OSS9U l        g[        U5      U l        g)zÚConstruct an ARRAY literal.

:param clauses: iterable, such as a list, containing elements to be
 rendered in the array
:param type\_: optional type.  If omitted, the type is inferred
 from the contents of the array.

Nr   r   é   )Ú
dimensions)ÚsuperÚ__init__r   Úcomma_opr6   r7   ÚsqltypesÚNULLTYPEÚ
isinstanceÚARRAYÚ	item_typer<   )Úselfr6   r9   ÚkwÚ	main_typeÚ	__class__s        €r,   r>   Úarray.__init__£   s¦   ø€ ô 	‰Òœ×+Ñ+Ð<¨gÒ<¸Ò<ð Ñ ñ à)-¯¯�—‘˜a‘×%Ò%¼8×;LÑ;Lð 	ô �i¤×'Ñ'ÜØ×#Ñ#ð !×+Ñ+Ñ7ð ×(Ñ(¨1Ò,àñˆD�Iô ˜iÓ(ˆD�Ir.   c                ó   • U 4$ ©N© ©rE   s    r,   Ú_select_iterableÚarray._select_iterableÆ   s	   € àˆwˆr.   c                óÜ   • U(       d  U[         R                  L a#  [        R                  " S UUUU R                  SS9$ [        U Vs/ s H  nU R                  XSUS9PM     sn5      $ s  snf )NT)Ú_compared_to_operatorr9   Ú_compared_to_typeÚunique)Ú_assume_scalarr9   )r   Úgetitemr   r   r7   r3   Ú_bind_param)rE   r+   Úobjr9   rT   Úos         r,   rV   Úarray._bind_paramÊ   s‰   € ö ˜X¬×):Ñ):Ò:Ü×+Ò+ØØØ&.ØØ"&§)¡)Øñð ô ñ
 !ó	ò !˜ð ×$Ñ$Ø °DÀð %ó ñ !ñ	óð ùòs   ÁA)c                ó˜   • U[         R                  [         R                  [         R                  4;   a  [        R
                  " U 5      $ U $ rK   )r   Úany_opÚall_oprU   r   r   )rE   Úagainsts     r,   Ú
self_groupÚarray.self_groupå   s;   € ð ”y×'Ñ'¬×)9Ñ)9¼9×;LÑ;LÐMÓMÜ×&Ò& tÓ,Ð,àˆKr.   )r7   )r6   zIterable[_T]r9   z!Optional[_TypeEngineArgument[_T]]rF   Ú
typing_Any)Úreturnr   )NF)
r+   r   rW   r`   r9   zOptional[TypeEngine[_T]]rT   Úboolra   zBindParameter[_T]rK   )r]   zOptional[OperatorType]ra   zUnion[Self, Grouping[_T]])Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__visit_name__Ústringify_dialectr   Údp_clauseelement_tupleÚdp_typer8   Ú__annotations__r>   ÚpropertyrN   rV   r^   Ú__static_attributes__Ú__classcell__)rH   s   @r,   r3   r3   L   sã   ø‡ ñKðZ €Nà$Ðð 
Ð%×<Ñ<Ð=Ø	Ð"×*Ñ*Ð+ð3ÐÐ/ó ð 48ñ	!)àð!)ð 1ð	!)ð
 ÷!)ð !)ðF óó ðð +/Ø$ðàðð ðð (ð	ð
 ðð 
õð8 15ðØ-ðà	"÷ó r.   r3   c                  óä   • \ rS rSrSr   S       SS jjr " S S\R                  R                  \	   5      r\r
\R                  SS j5       r    SS jr    SS	 jr      SS
 jrSrg)rC   éî   aª	  PostgreSQL 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])

Indexed access is one-based by default, to match that of PostgreSQL;
for zero-based indexed access, set
:paramref:`_postgresql.ARRAY.zero_indexes`.

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`.

.. container:: topic

    **Detecting Changes in ARRAY columns when using the ORM**

    The :class:`_postgresql.ARRAY` type, when used with the SQLAlchemy ORM,
    does not detect in-place mutations to the array. In order to detect
    these, the :mod:`sqlalchemy.ext.mutable` extension must be used, using
    the :class:`.MutableList` class::

        from sqlalchemy.dialects.postgresql import ARRAY
        from sqlalchemy.ext.mutable import MutableList


        class SomeOrmClass(Base):
            # ...

            data = Column(MutableList.as_mutable(ARRAY(Integer)))

    This extension will allow "in-place" changes such to the array
    such as ``.append()`` to produce events which will be detected by the
    unit of work.  Note that changes to elements **inside** the array,
    including subarrays that are mutated in place, are **not** detected.

    Alternatively, assigning a new array value to an ORM element that
    replaces the old one will always trigger a change event.

.. seealso::

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

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

Nc                ó¬   • [        U[        5      (       a  [        S5      e[        U[        5      (       a  U" 5       nXl        X l        X0l        X@l        g)au  Construct 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.

zUDo not nest ARRAY types; ARRAY(basetype) handles multi-dimensional arrays of basetypeN)rB   rC   Ú
ValueErrorr7   rD   Úas_tupler<   Úzero_indexes)rE   rD   rt   r<   ru   s        r,   r>   ÚARRAY.__init__6  sO   € ôN �i¤×'Ñ'Üð?óð ô �i¤×&Ñ&Ù!›ˆIØ"ŒØ ŒØ$ŒØ(Õr.   c                  óB   • \ rS rSrSr      SS jrS	S jrS	S jrSrg)
zARRAY.Comparatorii  a  Define comparison operations for :class:`_types.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`.

c                óH   • U R                  [        U[        R                  S9$ )zµBoolean expression.  Test if elements are a superset of the
elements of the argument array expression.

kwargs may be ignored by this operator but are required for API
conformance.
©Úresult_type)Úoperater   r@   ÚBoolean)rE   r)   Úkwargss      r,   ÚcontainsÚARRAY.Comparator.containss  s   € ð —<‘<¤¨%¼X×=MÑ=M�<ÐNÐNr.   c                óH   • U R                  [        U[        R                  S9$ )zlBoolean expression.  Test if elements are a proper subset of the
elements of the argument array expression.
ry   )r{   r   r@   r|   ©rE   r)   s     r,   Úcontained_byÚARRAY.Comparator.contained_by~  s'   € ð —<‘<Ü˜e´×1AÑ1Að  ð ð r.   c                óH   • U R                  [        U[        R                  S9$ )z]Boolean expression.  Test if array has elements in common with
an argument array expression.
ry   )r{   r   r@   r|   r�   s     r,   ÚoverlapÚARRAY.Comparator.overlap†  s   € ð —<‘<¤¨¼H×<LÑ<L�<ÐMÐMr.   rL   N)r)   r`   r}   r`   ra   úColumnElement[bool])r)   r`   ra   r‡   )	rc   rd   re   rf   rg   r~   r‚   r…   rn   rL   r.   r,   Ú
ComparatorÚARRAY.Comparatori  s3   † ñ	ð		OØ#ð		OØ/9ð		Oà ô		Oô	÷	Nr.   rˆ   c                ó„   • [        U R                  [        R                  5      =(       a    U R                  R                  $ rK   )rB   rD   r@   ÚEnumÚnative_enumrM   s    r,   Ú_against_native_enumÚARRAY._against_native_enumŽ  s-   € ô �t—~‘~¤x§}¡}Ó5÷ +Ø—‘×*Ñ*ð	
r.   c                ó†   ^ ^^• T R                   R                  U5      R                  U5      mTc  g SS jmSUU U4S jjnU$ )Nc                ó,   • SSR                  U 5       S3$ )NzARRAY[z, Ú])Újoin)Úelementss    r,   Úto_strÚ'ARRAY.literal_processor.<locals>.to_strž  s   € Ø˜DŸI™I hÓ/Ð0°Ð2Ð2r.   c                óD   >• TR                  U TTR                  T5      nU$ rK   )Ú_apply_item_processorr<   )ÚvalueÚinnerÚ	item_procrE   r”   s     €€€r,   ÚprocessÚ(ARRAY.literal_processor.<locals>.process¡  s'   ø€ Ø×.Ñ.Ø�y $§/¡/°6óˆEð ˆLr.   )r“   zIterable[typing_Any]ra   Ústr)r˜   úSequence[typing_Any]ra   r�   )rD   Údialect_implÚliteral_processor)rE   Údialectr›   rš   r”   s   `  @@r,   r    ÚARRAY.literal_processor•  sH   ú€ ð —N‘N×/Ñ/°Ó8×JÑJØó
ˆ	ð ÑØô	3÷	ñ 	ð ˆr.   c                óx   ^ ^• T R                   R                  U5      R                  U5      m    SUU 4S jjnU$ )Nc                óR   >• U c  U $ TR                  U TTR                  [        5      $ rK   )r—   r<   Úlist©r˜   rš   rE   s    €€r,   r›   Ú%ARRAY.bind_processor.<locals>.process°  s/   ø€ ð ‰}Ø�à×1Ñ1Ø˜9 d§o¡o´tóð r.   )r˜   úOptional[Sequence[typing_Any]]ra   zOptional[list[typing_Any]])rD   rŸ   Úbind_processor)rE   r¡   r›   rš   s   `  @r,   r©   ÚARRAY.bind_processor©  sH   ù€ ð —N‘N×/Ñ/°Ó8×GÑGØó
ˆ	ð	Ø1ð	à'÷	ð 	ð ˆr.   c                óú   ^ ^^^^• T R                   R                  U5      R                  X5      m    SUU 4S jjnT R                  (       a-  Um[        R
                  " S5      mSU4S jjm    SUU4S jjnU$ )Nc                óˆ   >• U c  U $ TR                  U TTR                  TR                  (       a
  [        5      $ [        5      $ rK   )r—   r<   rt   Útupler¥   r¦   s    €€r,   r›   Ú'ARRAY.result_processor.<locals>.processÃ  sG   ø€ ð ‰}Ø�à×1Ñ1ØØØ—O‘OØ!Ÿ]Ÿ]”Eó	ð ô 15ó	ð r.   z^{(.*)}$c                óZ   >• TR                  U 5      R                  S5      n[        U5      $ )Nr   )ÚmatchÚgroupÚ_split_enum_values)r˜   r™   Úpatterns     €r,   Úhandle_raw_stringÚ1ARRAY.result_processor.<locals>.handle_raw_stringÔ  s'   ø€ ØŸ™ eÓ,×2Ñ2°1Ó5�Ü)¨%Ó0Ð0r.   c                ó`   >• U c  U $ T" [        U [        5      (       a  T" U 5      5      $ U 5      $ rK   )rB   r�   )r˜   r´   Úsuper_rps    €€r,   r›   r®   Ø  sD   ø€ ð ‘=Ø �Lñ  ä! %¬×-Ñ-ñ & eÓ,óð ð óð r.   )r˜   rž   ra   r¨   )r˜   r�   ra   úSequence[Optional[str]])rD   rŸ   Úresult_processorr�   ÚreÚcompile)rE   r¡   Úcoltyper›   r´   rš   r³   r·   s   `   @@@@r,   r¹   ÚARRAY.result_processor¼  s…   ü€ ð —N‘N×/Ñ/°Ó8×IÑIØó
ˆ	ð	Ø'ð	à+÷	ð 	ð ×$×$ØˆHÜ—j’j Ó-ˆG÷1ðØ+ðà/÷ð ð ˆr.   )rt   r<   rD   ru   )FNF)rD   z_TypeEngineArgument[_T]rt   rb   r<   zOptional[int]ru   rb   )ra   rb   )r¡   r   ra   z#Optional[_LiteralProcessorType[_T]])r¡   r   ra   z2Optional[_BindProcessorType[Sequence[typing_Any]]])r¡   r   r¼   Úobjectra   z*_ResultProcessorType[Sequence[typing_Any]])rc   rd   re   rf   rg   r>   r@   rC   rˆ   r%   Úcomparator_factoryr   Úmemoized_propertyr�   r    r©   r¹   rn   rL   r.   r,   rC   rC   î   sÅ   † ñEðT Ø$(Ø"ð1)à*ð1)ð ð1)ð "ð	1)ð
 õ1)ôf!N�X—^‘^×.Ñ.¨sÑ3ô !NðF $Ðà	×Ñó
ó ð
ðØðà	,ôð(Øðà	;ôð&*Øð*Ø)/ð*à	3÷*r.   rC   c                ó  • SU ;  a3  U (       a  U R                  S5      O/  Vs/ s H  nUS:w  a  UOS PM     sn$ U R                  SS5      nUR                  SS5      n/ n[        R                   " SU5      nS	nU H{  nUS:X  a	  U(       + nM  U(       a#  UR                  UR                  SS5      5        M<  UR	                  [        R
                  " S
U5       Vs/ s H  nUS:w  a  UOS PM     sn5        M}     U$ s  snf s  snf )NÚ"Ú,ÚNULLz\"z_$ESC_QUOTE$_z\\Ú\z(")Fz([^\s,]+),?)ÚsplitÚreplacerº   ÚappendÚextendÚfindall)Úarray_stringÚrÚtextÚresultÚ	on_quotesÚ	in_quotesÚtoks          r,   r²   r²   é  s  € Ø
�,Óö 2>�l×(Ñ(¨Ô-À2ÐEó
âE�ð �f“‰A $Ò&ÙEñ
ð 	
ð ×Ñ  Ó7€DØ�<‰<˜˜tÓ$€DØ€FÜ—’˜ Ó&€IØ€IÛˆØ�#‹:Ø%œŠIÞØ�M‰M˜#Ÿ+™+ o°sÓ;Ö<ð �M‰Mô  ŸZšZ¨¸Ô<óâ<˜ð ˜f›‘A¨$Ò.Ù<ñöñ ð €Mùò7
ùò,s   £C<ÃD
)r)   r`   r*   z_ColumnExpressionArgument[_T]r+   r   ra   r‡   )rË   r�   ra   r¸   )6Ú
__future__r   rº   Útypingr   r`   r   r   r   r   r	   r
   r   r   r   r   Ú r   r@   r   Úsqlr   Úsql.visitorsr   Úengine.interfacesr   Úsql._typingr   r   Úsql.elementsr   r   Úsql.expressionr   Úsql.operatorsr   Úsql.selectabler   Úsql.type_apir   r   r   r    r!   Úutil.typingr"   r#   r%   Úeqr1   ÚExpressionClauseListr3   rC   r²   rL   r.   r,   Ú<module>rá      s  ðõ #ã 	Ý $Ý Ý Ý Ý  Ý Ý å #Ý Ý Ý !Ý Ý Ý Ý -æÝ,Ý8Ý2Ý-Ý(Ý/Ý-Ý1Ý2Ý5Ý4Ý*Ý6Ý#ñ ˆT˜Ñ$€Ùˆe˜:Ñ&€ð 'Ÿ\™\ð
(Øð
(à*ð
(ð ð
(ð õ	
(ð  'Ÿ\™\ð
(Øð
(à*ð
(ð ð
(ð õ	
(ô_ˆJ×+Ñ+¨BÑ/ô _ôDxˆH�N‰N˜2Ñô xõvr.   