ó
    Ñ]jID  ã                  óp  • 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  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  \	(       a0  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"\RB                  \(   5      r) " S# S$\5      r*S% r+ " S& S'\RX                  \(   5      r- " S( S)\-5      r. " S* S+\-5      r/ " S, S-\-5      r0 " S. S/\-5      r1 " S0 S1\-5      r2 " S2 S3\-5      r3g4)5é    )Úannotations)ÚAny)ÚIterable)ÚList)ÚOptional)Úoverload)ÚTuple)ÚTYPE_CHECKING)ÚTypeVaré   )Útypes)ÚARRAYé   )Ú	coercions)Úelements)Ú
expression)Ú	functions)Úroles)Úschema)ÚColumnCollectionConstraint)ÚTEXT)ÚInternalTraversal)Ú_ColumnExpressionArgument)Ú_DDLColumnArgument)ÚClauseElement)ÚColumnElement)ÚOperatorType)Ú
FromClause)Ú_CloneCallableType)Ú_TraverseInternalsTypeÚ_T)Úboundc                  ó*  • \ rS rSr% SrS rSrS\R                  4S\R                  4S\R                  4/r
S\S'   \    SS	 j5       r\    SS
 j5       r    SS jr S   SS jjrSS jr\R"                  4     SS jjr\SS j5       rSrg)Úaggregate_order_byé,   a¹  Represent a PostgreSQL aggregate order by expression.

E.g.::

    from sqlalchemy.dialects.postgresql import aggregate_order_by

    expr = func.array_agg(aggregate_order_by(table.c.a, table.c.b.desc()))
    stmt = select(expr)

would represent the expression:

.. sourcecode:: sql

    SELECT array_agg(a ORDER BY b DESC) FROM table;

Similarly::

    expr = func.string_agg(
        table.c.a, aggregate_order_by(literal_column("','"), table.c.a)
    )
    stmt = select(expr)

Would represent:

.. sourcecode:: sql

    SELECT string_agg(a, ',' ORDER BY a) FROM table;

.. versionchanged:: 1.2.13 - the ORDER BY argument may be multiple terms

.. seealso::

    :class:`_functions.array_agg`

Ú
postgresqlÚtargetÚtypeÚorder_byr    Ú_traverse_internalsc                ó   • g ©N© ©Úselfr'   r)   s      Ú_/home/mande/repo/quber/.venv/lib/python3.13/site-packages/sqlalchemy/dialects/postgresql/ext.pyÚ__init__Úaggregate_order_by.__init__Z   ó   € ð
 ó    c                ó   • g r,   r-   r.   s      r0   r1   r2   a   r3   r4   c                ó„  • [         R                  " [        R                  U5      U l        U R                  R
                  U l        [        U5      nU   US:X  a  [        S5      eUS:X  a.  [         R                  " [        R                  US   5      U l        g [        R                  " US[        R                  06U l        g )Nr   z)at least one ORDER BY element is requiredr   Ú_literal_as_text_role)r   Úexpectr   ÚExpressionElementRoler'   r(   ÚlenÚ	TypeErrorr)   r   Ú
ClauseList)r/   r'   r)   Ú_lobs       r0   r1   r2   h   s    € ô
 &/×%5Ò%5Ü×'Ñ'¨ó&
ˆŒð —K‘K×$Ñ$ˆŒ	ä�8‹}ˆÙØ�1‹9ÜÐGÓHÐHØ�Q‹YÜ%×,Ò,Ü×+Ñ+¨X°a©[óˆD�Mô %×/Ò/ØðÜ16×1LÑ1LñˆD�Mr4   Nc                ó   • U $ r,   r-   )r/   Úagainsts     r0   Ú
self_groupÚaggregate_order_by.self_group   s	   € ð ˆr4   c                ó2   • U R                   U R                  4$ r,   ©r'   r)   )r/   Úkwargss     r0   Úget_childrenÚaggregate_order_by.get_children„   s   € Ø�{‰{˜DŸM™MÐ)Ð)r4   c                ód   • U" U R                   40 UD6U l         U" U R                  40 UD6U l        g r,   rC   )r/   ÚcloneÚkws      r0   Ú_copy_internalsÚ"aggregate_order_by._copy_internals‡   s.   € ñ ˜DŸK™KÑ.¨2Ñ.ˆŒÙ˜dŸm™mÑ2¨rÑ2ˆ�r4   c                ó\   • U R                   R                  U R                  R                  -   $ r,   )r'   Ú_from_objectsr)   )r/   s    r0   rM   Ú aggregate_order_by._from_objects�   s!   € à�{‰{×(Ñ(¨4¯=©=×+FÑ+FÑFÐFr4   )r)   r'   r(   )r'   zColumnElement[_T]r)   ú_ColumnExpressionArgument[Any])r'   z_ColumnExpressionArgument[_T]r)   rO   r,   )r?   zOptional[OperatorType]Úreturnr   )rD   r   rP   zIterable[ClauseElement])rH   r   rI   r   rP   ÚNone)rP   zList[FromClause])Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__visit_name__Ústringify_dialectr   Údp_clauseelementÚdp_typer*   Ú__annotations__r   r1   r@   rE   r   Ú_clonerJ   ÚpropertyrM   Ú__static_attributes__r-   r4   r0   r$   r$   ,   s  ‡ ñ"ðH *€Nà$Ðà	Ð$×5Ñ5Ð6Ø	Ð"×*Ñ*Ð+Ø	Ð&×7Ñ7Ð8ð3ÐÐ/ó ð ðà!ðð 2óó ðð ðà-ðð 2óó ððà-ðð 2ôð0 15ðØ-ðà	õô
*ð +3¯/©/ð3Ø'ð3ØADð3à	õ3ð óGó óGr4   r$   c                  óŠ   ^ • \ rS rSrSrSrSrSrSr\	R                  " SSS	5            SS
 j5       rU 4S jrSS jrSrU =r$ )ÚExcludeConstrainté’   zÔA table-level EXCLUDE constraint.

Defines an EXCLUDE constraint as described in the `PostgreSQL
documentation`__.

__ https://www.postgresql.org/docs/current/static/sql-createtable.html#SQL-CREATETABLE-EXCLUDE

Úexclude_constraintNFr&   Úwherez:class:`.ExcludeConstraint`z$:paramref:`.ExcludeConstraint.where`c                ó®  • / n/ n0 U l         [        U6 u  pV[        [        R                  " [        R
                  U5      U5       HR  u  u  pxpšnU
b  UR                  U
5        Ub  UR                  OU	nUb  X°R                   U'   UR                  X|U45        MT     X@l        [        R                  " U /UQ7UR                  S5      UR                  S5      UR                  S5      S.6  UR                  SS5      U l        UR                  S5      nUb*  [        R                  " [        R                  U5      U l        UR                  S	0 5      U l        g)
a·
  
Create an :class:`.ExcludeConstraint` object.

E.g.::

    const = ExcludeConstraint(
        (Column("period"), "&&"),
        (Column("group"), "="),
        where=(Column("group") != "some group"),
        ops={"group": "my_operator_class"},
    )

The constraint is normally embedded into the :class:`_schema.Table`
construct
directly, or added later using :meth:`.append_constraint`::

    some_table = Table(
        "some_table",
        metadata,
        Column("id", Integer, primary_key=True),
        Column("period", TSRANGE()),
        Column("group", String),
    )

    some_table.append_constraint(
        ExcludeConstraint(
            (some_table.c.period, "&&"),
            (some_table.c.group, "="),
            where=some_table.c.group != "some group",
            name="some_table_excl_const",
            ops={"group": "my_operator_class"},
        )
    )

The exclude constraint defined in this example requires the
``btree_gist`` extension, that can be created using the
command ``CREATE EXTENSION btree_gist;``.

:param \*elements:

  A sequence of two tuples of the form ``(column, operator)`` where
  "column" is either a :class:`_schema.Column` object, or a SQL
  expression element (e.g. ``func.int8range(table.from, table.to)``)
  or the name of a column as string, and "operator" is a string
  containing the operator to use (e.g. `"&&"` or `"="`).

  In order to specify a column name when a :class:`_schema.Column`
  object is not available, while ensuring
  that any necessary quoting rules take effect, an ad-hoc
  :class:`_schema.Column` or :func:`_expression.column`
  object should be used.
  The ``column`` may also be a string SQL expression when
  passed as :func:`_expression.literal_column` or
  :func:`_expression.text`

:param name:
  Optional, the in-database name of this constraint.

:param deferrable:
  Optional bool.  If set, emit DEFERRABLE or NOT DEFERRABLE when
  issuing DDL for this constraint.

:param initially:
  Optional string.  If set, emit INITIALLY <value> when issuing DDL
  for this constraint.

:param using:
  Optional string.  If set, emit USING <index_method> when issuing DDL
  for this constraint. Defaults to 'gist'.

:param where:
  Optional SQL expression construct or literal SQL string.
  If set, emit WHERE <predicate> when issuing DDL
  for this constraint.

:param ops:
  Optional dictionary.  Used to define operator classes for the
  elements; works the same way as that of the
  :ref:`postgresql_ops <postgresql_operator_classes>`
  parameter specified to the :class:`_schema.Index` construct.

  .. versionadded:: 1.3.21

  .. seealso::

    :ref:`postgresql_operator_classes` - general description of how
    PostgreSQL operator classes are specified.

NÚnameÚ
deferrableÚ	initially)re   rf   rg   ÚusingÚgistrc   Úops)Ú	operatorsÚzipr   Ú expect_col_expression_collectionr   ÚDDLConstraintColumnRoleÚappendre   Ú_render_exprsr   r1   Úgetrh   r8   ÚStatementOptionRolerc   rj   )r/   r   rI   ÚcolumnsÚrender_exprsÚexpressionsrk   ÚexprÚcolumnÚstrnameÚadd_elementÚoperatorre   rc   s                 r0   r1   ÚExcludeConstraint.__init__£   s@  € ðB ˆØˆØˆŒä!$ h Ñˆä>AÜ×6Ò6Ü×-Ñ-¨{óð ö	?
Ñ:Ñ0ˆT˜7°(ð Ñ&Ø—‘˜{Ô+à"(Ñ"4�6—;’;¸'ˆDàÑà'/—‘˜tÑ$à×Ñ ¨XÐ 6Ö7ñ?
ð" *Ôä"×+Ò+Øð	
àñ	
ð —‘˜“Ø—v‘v˜lÓ+Ø—f‘f˜[Ó)ó	
ð —V‘V˜G VÓ,ˆŒ
Ø—‘�w“ˆØÑÜ"×)Ò)¬%×*CÑ*CÀUÓKˆDŒJà—6‘6˜% Ó$ˆ�r4   c           	     óÒ   >• [         TU ]  U5        U R                   VVVs/ s H/  u  p4n[        U[        5      (       d  UOUR
                  U   UU4PM1     snnnU l        g s  snnnf r,   )ÚsuperÚ_set_parentrp   Ú
isinstanceÚstrÚc)r/   ÚtablerI   rv   re   rz   Ú	__class__s         €r0   r~   ÚExcludeConstraint._set_parent+  sg   ø€ Ü‰Ñ˜EÔ"ð *.×);Ò);õ
ò *<Ñ$�˜Hô	 ' t¬S×1Ñ1‘°u·w±w¸t±}ØØóñ
 *<ó
ˆÕùô 
s   ¡6A"c           
     óv  • U R                    VVVs/ s H)  u  p4n[        R                  " X0R                  U5      U4PM+     nnnnU R                  " UU R
                  U R                  U R                  U R                  U R                  S.6nUR                  R                  U R                  5        U$ s  snnnf )N)re   rf   rg   rc   rh   )rp   r   Ú_copy_expressionÚparentrƒ   re   rf   rg   rc   rh   ÚdispatchÚ_update)r/   Útarget_tablerI   rv   Ú_rz   r   r�   s           r0   Ú_copyÚExcludeConstraint._copy7  s¤   € ð &*×%7Ò%7õ
ò
 &8Ñ!�˜ô ×'Ò'¨¯k©k¸<ÓHØóñ &8ð 	ò 
ð �NŠNØØ—‘Ø—‘Ø—n‘nØ—*‘*Ø—*‘*ò
ˆð 	
�
‰
×Ñ˜4Ÿ=™=Ô)Øˆùô!
s   ‘0B4)rp   rk   rj   rh   rc   )r   zTuple[_DDLColumnArgument, str]rI   r   rP   rQ   r,   )rR   rS   rT   rU   rV   rW   rc   Úinherit_cacheÚcreate_drop_stringify_dialectr   Ú_document_text_coercionr1   r~   rŒ   r^   Ú__classcell__©rƒ   s   @r0   r`   r`   ’   sr   ø† ñð *€Nà€EØ€Mà$0Ð!à×%Ò%ØØ%Ø.óð
A%Ø7ðA%Ø?BðA%à	óA%óð
A%õF

÷ò r4   r`   c                 óT   • [         US'   [        R                  R                  " U 0 UD6$ )z¿PostgreSQL-specific form of :class:`_functions.array_agg`, ensures
return type is :class:`_postgresql.ARRAY` and not
the plain :class:`_types.ARRAY`, unless an explicit ``type_``
is passed.

Ú_default_array_type)r   r   ÚfuncÚ	array_agg)ÚargrI   s     r0   r–   r–   K  s)   € ô !&€BÐÑÜ�>‰>×#Ò# SÐ/¨BÑ/Ð/r4   c                  ó,   ^ • \ rS rSrSrU 4S jrSrU =r$ )Ú_regconfig_fniV  Tc                ó�  >• [        U5      n[        U5      S:”  aR  [        R                  " [        R
                  UR                  S5      [        U SS 5      U [        R                  S9nU/nO/ nU Vs/ s H3  n[        R                  " [        R
                  U[        U SS 5      U S9PM5     nn[        TU ],  " X5-   0 UD6  g s  snf )Nr   r   re   )re   Úapply_propagate_attrsÚtype_©re   r›   )Úlistr:   r   r8   r   r9   ÚpopÚgetattrr   Ú	REGCONFIGr}   r1   )r/   ÚargsrD   Úinitial_argr�   Ú
addtl_argsrƒ   s         €r0   r1   Ú_regconfig_fn.__init__Y  sÇ   ø€ Ü�D‹zˆÜˆt‹9�q‹=Ü#×*Ò*Ü×+Ñ+Ø—‘˜“Ü˜T 6¨4Ó0Ø&*Ü—o‘oñˆKð '˜-‰KàˆKñ ó
ò �ô ×ÒÜ×+Ñ+ØÜ˜T 6¨4Ó0Ø&*ô	ñ ð 	ð 
ô 	‰Ò˜;Ñ3Ð?¸Ó?ùò
s   Á4:Cr-   )rR   rS   rT   rU   rŽ   r1   r^   r‘   r’   s   @r0   r™   r™   V  s   ø† Ø€M÷@ó @r4   r™   c                  ó4   • \ rS rSrSrSr\R                  rSr	g)Úto_tsvectoris  a›  The PostgreSQL ``to_tsvector`` SQL function.

This function applies automatic casting of the REGCONFIG argument
to use the :class:`_postgresql.REGCONFIG` datatype automatically,
and applies a return type of :class:`_postgresql.TSVECTOR`.

Assuming the PostgreSQL dialect has been imported, either by invoking
``from sqlalchemy.dialects import postgresql``, or by creating a PostgreSQL
engine using ``create_engine("postgresql...")``,
:class:`_postgresql.to_tsvector` will be used automatically when invoking
``sqlalchemy.func.to_tsvector()``, ensuring the correct argument and return
type handlers are used at compile and execution time.

.. versionadded:: 2.0.0rc1

Tr-   N)
rR   rS   rT   rU   rV   rŽ   r   ÚTSVECTORr(   r^   r-   r4   r0   r§   r§   s  s   † ñð" €MØ�>‰>ƒDr4   r§   c                  ó4   • \ rS rSrSrSr\R                  rSr	g)Ú
to_tsqueryi‰  a—  The PostgreSQL ``to_tsquery`` SQL function.

This function applies automatic casting of the REGCONFIG argument
to use the :class:`_postgresql.REGCONFIG` datatype automatically,
and applies a return type of :class:`_postgresql.TSQUERY`.

Assuming the PostgreSQL dialect has been imported, either by invoking
``from sqlalchemy.dialects import postgresql``, or by creating a PostgreSQL
engine using ``create_engine("postgresql...")``,
:class:`_postgresql.to_tsquery` will be used automatically when invoking
``sqlalchemy.func.to_tsquery()``, ensuring the correct argument and return
type handlers are used at compile and execution time.

.. versionadded:: 2.0.0rc1

Tr-   N©
rR   rS   rT   rU   rV   rŽ   r   ÚTSQUERYr(   r^   r-   r4   r0   rª   rª   ‰  ó   † ñð" €MØ�=‰=ƒDr4   rª   c                  ó4   • \ rS rSrSrSr\R                  rSr	g)Úplainto_tsqueryiŸ  a¦  The PostgreSQL ``plainto_tsquery`` SQL function.

This function applies automatic casting of the REGCONFIG argument
to use the :class:`_postgresql.REGCONFIG` datatype automatically,
and applies a return type of :class:`_postgresql.TSQUERY`.

Assuming the PostgreSQL dialect has been imported, either by invoking
``from sqlalchemy.dialects import postgresql``, or by creating a PostgreSQL
engine using ``create_engine("postgresql...")``,
:class:`_postgresql.plainto_tsquery` will be used automatically when
invoking ``sqlalchemy.func.plainto_tsquery()``, ensuring the correct
argument and return type handlers are used at compile and execution time.

.. versionadded:: 2.0.0rc1

Tr-   Nr«   r-   r4   r0   r¯   r¯   Ÿ  r­   r4   r¯   c                  ó4   • \ rS rSrSrSr\R                  rSr	g)Úphraseto_tsqueryiµ  a©  The PostgreSQL ``phraseto_tsquery`` SQL function.

This function applies automatic casting of the REGCONFIG argument
to use the :class:`_postgresql.REGCONFIG` datatype automatically,
and applies a return type of :class:`_postgresql.TSQUERY`.

Assuming the PostgreSQL dialect has been imported, either by invoking
``from sqlalchemy.dialects import postgresql``, or by creating a PostgreSQL
engine using ``create_engine("postgresql...")``,
:class:`_postgresql.phraseto_tsquery` will be used automatically when
invoking ``sqlalchemy.func.phraseto_tsquery()``, ensuring the correct
argument and return type handlers are used at compile and execution time.

.. versionadded:: 2.0.0rc1

Tr-   Nr«   r-   r4   r0   r±   r±   µ  r­   r4   r±   c                  ó4   • \ rS rSrSrSr\R                  rSr	g)Úwebsearch_to_tsqueryiË  aµ  The PostgreSQL ``websearch_to_tsquery`` SQL function.

This function applies automatic casting of the REGCONFIG argument
to use the :class:`_postgresql.REGCONFIG` datatype automatically,
and applies a return type of :class:`_postgresql.TSQUERY`.

Assuming the PostgreSQL dialect has been imported, either by invoking
``from sqlalchemy.dialects import postgresql``, or by creating a PostgreSQL
engine using ``create_engine("postgresql...")``,
:class:`_postgresql.websearch_to_tsquery` will be used automatically when
invoking ``sqlalchemy.func.websearch_to_tsquery()``, ensuring the correct
argument and return type handlers are used at compile and execution time.

.. versionadded:: 2.0.0rc1

Tr-   Nr«   r-   r4   r0   r³   r³   Ë  r­   r4   r³   c                  ó4   ^ • \ rS rSrSrSr\rU 4S jrSr	U =r
$ )Úts_headlineiá  a’  The PostgreSQL ``ts_headline`` SQL function.

This function applies automatic casting of the REGCONFIG argument
to use the :class:`_postgresql.REGCONFIG` datatype automatically,
and applies a return type of :class:`_types.TEXT`.

Assuming the PostgreSQL dialect has been imported, either by invoking
``from sqlalchemy.dialects import postgresql``, or by creating a PostgreSQL
engine using ``create_engine("postgresql...")``,
:class:`_postgresql.ts_headline` will be used automatically when invoking
``sqlalchemy.func.ts_headline()``, ensuring the correct argument and return
type handlers are used at compile and execution time.

.. versionadded:: 2.0.0rc1

Tc                óF  >• [        U5      n[        U5      S:  a  SnOQ[        US   [        R                  5      (       a-  US   R
                  R                  [        R                  L a  SnOSnU(       aR  [        R                  " [        R                  UR                  S5      U [        U SS 5      [        R                  S9nU/nO/ nU Vs/ s H3  n[        R                  " [        R                  U[        U SS 5      U S9PM5     nn[         TU ]D  " XF-   0 UD6  g s  snf )	Né   Fr   Tr   re   )r›   re   rœ   r�   )rž   r:   r   r   r   r(   Ú_type_affinityr   r¬   r   r8   r   r9   rŸ   r    r¡   r}   r1   )r/   r¢   rD   Úhas_regconfigr£   r�   r¤   rƒ   s          €r0   r1   Úts_headline.__init__ö  s  ø€ Ü�D‹zˆô ˆt‹9�q‹=à!‰Mä�t˜A‘w¤× 6Ñ 6×7Ñ7Ø�Q‘—‘×+Ñ+¬u¯}©}Ò<ð "‰Mà ˆMæÜ#×*Ò*Ü×+Ñ+Ø—‘˜“Ø&*Ü˜T 6¨4Ó0Ü—o‘oñˆKð '˜-‰KàˆKñ ó
ò �ô ×ÒÜ×+Ñ+ØÜ˜T 6¨4Ó0Ø&*ô	ñ ð 	ð 
ô 	‰Ò˜;Ñ3Ð?¸Ó?ùò
s   Ã:Dr-   )rR   rS   rT   rU   rV   rŽ   r   r(   r1   r^   r‘   r’   s   @r0   rµ   rµ   á  s    ø† ñð" €MØ€D÷&@ó &@r4   rµ   N)4Ú
__future__r   Útypingr   r   r   r   r   r	   r
   r   Ú r   Úarrayr   Úsqlr   r   r   r   r   r   Ú
sql.schemar   Úsql.sqltypesr   Úsql.visitorsr   Úsql._typingr   r   Úsql.elementsr   r   Úsql.operatorsr   Úsql.selectabler   r   r    r!   r$   r`   r–   ÚGenericFunctionr™   r§   rª   r¯   r±   r³   rµ   r-   r4   r0   Ú<module>rÈ      sþ   ðõ #å Ý Ý Ý Ý Ý Ý  Ý å Ý Ý Ý Ý Ý Ý Ý Ý 4Ý  Ý -æÝ8Ý1Ý-Ý-Ý-Ý,Ý2Ý6áˆT˜Ñ€ôcG˜×1Ñ1°"Ñ5ô cGôLvÐ2ô vòr0ô@�I×-Ñ-¨bÑ1ô @ô:�-ô ô,�ô ô,�mô ô,�}ô ô,˜=ô ô,;@�-õ ;@r4   