+
    ieF                       ^ RI Ht ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 ^ R	IH
t
 ^R
IHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ]	'       d1   ^RIHt ^RIHt ^RIH t  ^RIH!t! ^RI"H#t# ^RI$H%t% ^RIH&t& ^RIH't' ]
! R]R7      t( ! R R ]PB                  ](,          4      t) ! R! R"]4      t*R# t+ ! R$ R%]PX                  ](,          4      t- ! R& R']-4      t. ! R( R)]-4      t/ ! R* R+]-4      t0 ! R, R-]-4      t1 ! R. R/]-4      t2 ! R0 R1]-4      t3R2# )3    )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                     ] tR t^,t$ RtR tRtR]P                  3R]P                  3R]P                  3.t
R]R&   ]R R	 l4       t]R
 R l4       tR R ltRR R lltR R lt]P"                  3R R llt]R R l4       tRtR# )aggregate_order_bya  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                    V ^8  d   QhRRRR/# )   r$   zColumnElement[_T]r&   _ColumnExpressionArgument[Any] )formats   "|C:\Users\petid\OneDrive\Desktop\Maestro\MAESTRO\maestro-backend\venv\Lib\site-packages\sqlalchemy/dialects/postgresql/ext.py__annotate__aggregate_order_by.__annotate__[   s      ! 2    c                	    R # Nr+   selfr$   r&   s   &&*r-   __init__aggregate_order_by.__init__Z       
 r0   c                    V ^8  d   QhRRRR/# r)   r$   z_ColumnExpressionArgument[_T]r&   r*   r+   )r,   s   "r-   r.   r/   b   s      - 2r0   c                	    R # r2   r+   r3   s   &&*r-   r5   r6   a   r7   r0   c                    V ^8  d   QhRRRR/# r9   r+   )r,   s   "r-   r.   r/   h   s      - 2r0   c                	   \         P                  ! \        P                  V4      V n        V P                  P
                  V n        \        V4      pV  V^ 8X  d   \        R4      hV^8X  d4   \         P                  ! \        P                  V^ ,          4      V n        R# \        P                  ! VR\        P                  / V n        R# )r   z)at least one ORDER BY element is required_literal_as_text_roleN)r   expectr   ExpressionElementRoler$   r%   len	TypeErrorr&   r   
ClauseList)r4   r$   r&   _lobs   &&* r-   r5   r6   h   s    
 &/%5%5''&
 KK$$	8}19GHHQY%,,++Xa[DM %//161L1LDMr0   Nc                    V ^8  d   QhRRRR/# )r)   againstzOptional[OperatorType]returnr   r+   )r,   s   "r-   r.   r/      s      -	r0   c                	    V # r2   r+   )r4   rE   s   &&r-   
self_groupaggregate_order_by.self_group   s	     r0   c                    V ^8  d   QhRRRR/# )r)   kwargsr   rF   zIterable[ClauseElement]r+   )r,   s   "r-   r.   r/      s     * *S *-D *r0   c                	2    V P                   V P                  3# r2   r$   r&   )r4   rK   s   &,r-   get_childrenaggregate_order_by.get_children   s    {{DMM))r0   c               $    V ^8  d   QhRRRRRR/# )r)   cloner   kwr   rF   Noner+   )r,   s   "r-   r.   r/      s$     3 3'3AD3	3r0   c                	f    V! V P                   3/ VB V n         V! V P                  3/ VB V n        R # r2   rM   )r4   rQ   rR   s   &&,r-   _copy_internals"aggregate_order_by._copy_internals   s.     DKK.2.dmm2r2r0   c                   V ^8  d   QhRR/# )r)   rF   zList[FromClause]r+   )r,   s   "r-   r.   r/      s     G G/ Gr0   c                	d    V P                   P                  V P                  P                  ,           # r2   )r$   _from_objectsr&   )r4   s   &r-   rY    aggregate_order_by._from_objects   s!    {{((4==+F+FFFr0   )r&   r$   r%   r2   )__name__
__module____qualname____firstlineno____doc____visit_name__stringify_dialectr   dp_clauseelementdp_typer'   __annotations__r   r5   rH   rN   r   _clonerU   propertyrY   __static_attributes__r+   r0   r-   r"   r"   ,   s    "H *N$	$556	"**+	&7783/     .
* +3//3 G Gr0   r"   c                     a  ] tR t^tRtRtRtRtRt]	P                  ! RRR4      R	 R
 l4       tV 3R ltRR ltRtV ;t# )ExcludeConstraintzA 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               $    V ^8  d   QhRRRRRR/# )r)   r   zTuple[_DDLColumnArgument, str]rR   r   rF   rS   r+   )r,   s   "r-   r.   ExcludeConstraint.__annotate__   s)     A% A%7A%?BA%	A%r0   c                   . p. p/ V n         \        V!  w  rV\        \        P                  ! \        P
                  V4      V4       FU  w  w  rxrpV
e   VP                  V
4       Ve   VP                  MT	pVe   WP                   V&   VP                  W|V34       KW  	  W@n        \        P                  ! V .VO5RVP                  R4      RVP                  R4      RVP                  R4      /  VP                  RR4      V n        VP                  R4      pVe+   \        P                  ! \        P                  V4      V n        VP                  R/ 4      V n        R# )	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usinggistrk   ops)	operatorszipr    expect_col_expression_collectionr   DDLConstraintColumnRoleappendro   _render_exprsr   r5   getrr   r>   StatementOptionRolerk   rt   )r4   r   rR   columnsrender_exprsexpressionsru   exprcolumnstrnameadd_elementoperatorro   rk   s   &*,           r-   r5   ExcludeConstraint.__init__   sN   B !$h>A66--{ 	?
:0T7( &{+"("46;;'D'/t$X 67?
" *"++	
	
 	
 vvl+		

 ff[)	
 VVGV,
w"))%*C*CUKDJ66%$r0   c           	     	   < \         SV `  V4       V P                   UUUu. uF4  w  r4p\        V\        4      '       g   TMVP
                  V,          VV3NK6  	  upppV n        R # u upppi r2   )super_set_parentrz   
isinstancestrc)r4   tablerR   r   ro   r   	__class__s   &&,   r-   r   ExcludeConstraint._set_parent+  sg    E" *.););
 *<$H	 'tS11uwwt}
 *<
 
s   :A'c                	|   V P                    UUUu. uF)  w  r4p\        P                  ! W0P                  V4      V3NK+  	  ppppV P                  ! VR V P
                  RV P                  RV P                  RV P                  RV P                  / pVP                  P                  V P                  4       V# u upppi )ro   rp   rq   rk   rr   )rz   r   _copy_expressionparentr   ro   rp   rq   rk   rr   dispatch_update)r4   target_tablerR   r   _r   r   r   s   &&,     r-   _copyExcludeConstraint._copy7  s     &*%7%7

 &8! ''kk<H &8 	 
 NN

 
 nn	

 **
 **
 	


4==)!
s   /B7)rz   ru   rt   rr   rk   r2   )r[   r\   r]   r^   r_   r`   rk   inherit_cachecreate_drop_stringify_dialectr   _document_text_coercionr5   r   r   rg   __classcell__r   s   @r-   ri   ri      sW     *NEM$0!%%%.
A%
A%F

 r0   ri   c                 T    \         VR&   \        P                  P                  ! V / VB # )zPostgreSQL-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)argrR   s   *,r-   r   r   K  s)     !&B>>##S/B//r0   c                  ,   a  ] tR tRtRtV 3R ltRtV ;t# )_regconfig_fniV  Tc                	  < \        V4      p\        V4      ^8  dV   \        P                  ! \        P
                  VP                  ^ 4      \        V RR4      V \        P                  R7      pV.pM. pV Uu. uF6  p\        P                  ! \        P
                  V\        V RR4      V R7      NK8  	  pp\        SV `,  ! W5,           / VB  R# u upi )   ro   N)ro   apply_propagate_attrstype_ro   r   )listr@   r   r>   r   r?   popgetattrr   	REGCONFIGr   r5   )r4   argsrK   initial_argr   
addtl_argsr   s   &*,   r-   r5   _regconfig_fn.__init__Y  s    Dzt9q=#**++T640&*ooK '-KK 
  ++T640&*	  	 
 	;3??
s   8<Cr+   )r[   r\   r]   r^   r   r5   rg   r   r   s   @r-   r   r   V  s    M@ @r0   r   c                  6    ] tR tRtRtRt]P                  tRt	R# )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)
r[   r\   r]   r^   r_   r   r   TSVECTORr%   rg   r+   r0   r-   r   r   s  s    " M>>Dr0   r   c                  6    ] tR tRtRtRt]P                  tRt	R# )
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
r[   r\   r]   r^   r_   r   r   TSQUERYr%   rg   r+   r0   r-   r   r         " M==Dr0   r   c                  6    ] tR tRtRtRt]P                  tRt	R# )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+   r0   r-   r   r     r   r0   r   c                  6    ] tR tRtRtRt]P                  tRt	R# )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+   r0   r-   r   r     r   r0   r   c                  6    ] tR tRtRtRt]P                  tRt	R# )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+   r0   r-   r   r     r   r0   r   c                  4   a  ] tR tRtRtRt]tV 3R ltRt	V ;t
# )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                	r  < \        V4      p\        V4      ^8  d   RpM[\        V^,          \        P                  4      '       d3   V^,          P
                  P                  \        P                  J d   RpMRpV'       dV   \        P                  ! \        P                  VP                  ^ 4      V \        V RR4      \        P                  R7      pV.pM. pV Uu. uF6  p\        P                  ! \        P                  V\        V RR4      V R7      NK8  	  pp\         SV `D  ! WF,           / VB  R# u upi )r)   FTro   N)r   ro   r   r   )r   r@   r   r   r   r%   _type_affinityr   r   r   r>   r   r?   r   r   r   r   r5   )r4   r   rK   has_regconfigr   r   r   r   s   &*,    r-   r5   ts_headline.__init__  s   Dz t9q=!MtAw 6 677Q++u}}< "M M#**++&*T640ooK '-KK 
  ++T640&*	  	 
 	;3??
s   <D4r+   )r[   r\   r]   r^   r_   r   r   r%   r5   rg   r   r   s   @r-   r   r     s     " MD&@ &@r0   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"   ri   r   GenericFunctionr   r   r   r   r   r   r   r+   r0   r-   <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 ,} ,= ,;@- ;@r0   