
    ,h޶                      S r SSKJr  SSKJr  SSKJr  SSKrSSKrSSK	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  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.J0r0  SS(K.J1r1  SS)K.J2r2  SS*K.J3r3  SS+K.J4r4  SS,K.J5r5  SS-K.J6r6  SS.K.J7r7  SS/K.J8r8  SS0K9J:r:  SS1K9J;r;  SS2K!J<r<  SS3K"J=r=  SS4K$J>r>  SS5K?J@r@  SS6K?JArA  SS7K?JBrB  SS8K?JCrC  SS9K?JDrD  S:S;K JErE  S:S<K JFrF  S:S=K JGrG  S:S>KGJHrH  S:S?KGJIrI  S:S@KJJKrK  S:SAKJJLrL  S:SBKJJMrM  \
R:                  (       a  SSCK&JNrN  SSDK&JOrO  SSEK&JPrP  SSFK&JQrQ  SSGK&JRrR  SSHK&JSrS  SSIK&JTrT  SSJK.JUrU  SSKK9JVrV  SSLK9JWrW  SSMKXJYrY  SSNKXJZrZ  SSOK[J\r\  SSPK"J]r]  SSQK^J_r_  SSRK^J`r`  SSSK^Jara  SSTK^Jbrb  SSUKcJdrd  SSVKcJere  SSWKcJfrf  SSXKcJgrg  SSYKhJiri  SSZK%Jjrj  SS[K?Jkrk  SS\K?Jlrl  SS]K?Jmrm  S:S^KnJoro  S:S_KnJprp  S:S`KqJrrr  S:SaKqJsrs  S:SbKqJtrt  S:ScKqJuru  S:SdKqJvrv  S:SeKwJxrx  \\y\4   rz\\y\{\4   r|\" SfSgSh9r}\" Si\SjSk9r~\" SlSgSh9r\" SmSnSh9r\" SoSpSh9r\ S       SSq jj5       r\  S       SSr jj5       r\  S       SSs jj5       r  S       SSt jjr S     SSu jjr " Sv Sw\D5      r\FGR
                   " Sx Sy\-\:\>\A\5      5       r " Sz S{\5      r " S| S}\#GR                  \#GR                  \#GR                  \5      r " S~ S\\~   \=\I5      r " S S\\~   \#GR                  \~   \I5      r\r " S S\#GR                   \#GR"                  \#GR$                  \#GR&                  \}   \#GR(                  \#GR                  \#GR*                  \#GR                  \#GR                  \#GR,                  \\}   \5      r " S S\\}   5      r " S S\\}   5      r " S S\#GR4                  \\}   5      r " S S\5      r " S S\#GR                  \#GR,                  \#GR"                  \#GR$                  \#GR(                  \#GR:                  \#GR<                  \#GR4                  \4\3\\#GR&                  \   \FGR>                  S   5      r " S S\8\#GRB                  S   \S   5      r\GRG                  5          " S S\8\#GRB                  \   \\   5      r\GRG                  5          " S S\8\#GRB                  \   \\   5      r\GRG                  5          " S S\#GR4                  \#GR(                  \#GR                  \#GR                  \5      r " S S\\}   5      r " S S\\}   5      r " S S\\   5      r\GRV                  r\GRX                  r " S S\\\\S4      5      r " S S\\}   5      r " S S\\}   5      r " S S\\}   5      r " S S\\}   5      r " S S\\{   5      r " S S\\}   5      r " S S\\   5      r " S S\\}   5      r " S S\\}   5      r " S S\\   \\   5      r " S S\\}   5      r " S S\\   5      r " S S\\   5      r " S S\5      r " S S\\\}   5      r " S S\\}   5      r " S S\5      r\GR|                  r\GR~                  r\\{\4   r " S S\\}   5      r " S S\\}   5      r " S S\4\\}   5      r " S S\\}   5      r\L" S5      r " S S\#GR                  \}   \\}   5      r " S S\#GR                  \#GR                  \}   \#GR                  \6\\}   5      r " S S\\}   5      r " S S\\   5      r " S S\3\5      r " S S\5      r " S S\5      r " S S\5      r " S S\GGR                  \5      rSS jrSS jrSS jr " S S\GGR                  S   5      r " S S\,5      r " S S\5      r " S S\5      r\r " S S\5      rg)zCore SQL expression elements, including :class:`_expression.ClauseElement`,
:class:`_expression.ColumnElement`, and derived classes.

    )annotations)Decimal)EnumN)AbstractSet)Any)Callable)cast)Dict)	FrozenSet)Generic)Iterable)Iterator)List)Mapping)Optional)overload)Sequence)Set)Tuple)Type)TYPE_CHECKING)TypeVar)Union   )	coercions)	operators)roles)
traversals)type_api)has_schema_attr)is_named_from_clause)is_quoted_name)is_tuple_type)	Annotated)SupportsWrappingAnnotations)_clone)_expand_cloned)_generative)_NoArg)
Executable)
Generative)HasMemoized)	Immutable)NO_ARG)SingletonConstant)MemoizedHasCacheKey)NO_CACHE)_document_text_coercion)ColumnOperators)HasCopyInternals)cloned_traverse)ExternallyTraversible)InternalTraversal)traverse)	Visitable   )exc)
inspection)util)!HasMemoized_ro_memoized_attribute)
TypingOnly)Literal)	ParamSpec)Self)_ByArgument)_ColumnExpressionArgument)#_ColumnExpressionOrStrLabelArgument)_HasDialect)	_InfoType)_PropagateAttrsType)_TypeEngineArgument)	ColumnSet)_CacheKeyTraversalType)CacheKey)Compiled)SQLCompiler)FunctionElement)OperatorType)Column)DefaultGenerator)FetchedValue)
ForeignKey)_SelectIterable)
FromClause)NamedFromClause)TextualSelect)	TupleType)
TypeEngine)_CloneCallableType)_TraverseInternalsType)anon_map)
Connection)Dialect)_CoreMultiExecuteParams)
CacheStats)CompiledCacheType)CoreExecuteOptionsParameter)SchemaTranslateMapType)Result_Tr   )bound_T_coT)rg   	covariant_OPT_NT_NUMERIC_NMT_NUMBERc                    g N valuetype_literal_executes      O/var/www/auris/envauris/lib/python3.13/site-packages/sqlalchemy/sql/elements.pyliteralrw          
     c                    g rp   rq   rr   s      rv   rw   rw      rx   ry   c                    g rp   rq   rr   s      rv   rw   rw      s    
 ry   c                L    [         R                  " [        R                  U UUS9$ )a  Return a literal clause, bound to a bind parameter.

Literal clauses are created automatically when non-
:class:`_expression.ClauseElement` objects (such as strings, ints, dates,
etc.) are
used in a comparison operation with a :class:`_expression.ColumnElement`
subclass,
such as a :class:`~sqlalchemy.schema.Column` object.  Use this function
to force the generation of a literal clause, which will be created as a
:class:`BindParameter` with a bound value.

:param value: the value to be bound. Can be any Python object supported by
 the underlying DB-API, or is translatable via the given type argument.

:param type\_: an optional :class:`~sqlalchemy.types.TypeEngine` which will
 provide bind-parameter translation for this literal.

:param literal_execute: optional bool, when True, the SQL engine will
 attempt to render the bound value directly in the SQL statement at
 execution time rather than providing as a parameter value.

 .. versionadded:: 2.0

)rt   ru   )r   expectr   LiteralValueRolerr   s      rv   rw   rw      s)    : '	 ry   c                    [        XSS9$ )a@  Produce a :class:`.ColumnClause` object that has the
:paramref:`_expression.column.is_literal` flag set to True.

:func:`_expression.literal_column` is similar to
:func:`_expression.column`, except that
it is more often used as a "standalone" column expression that renders
exactly as stated; while :func:`_expression.column`
stores a string name that
will be assumed to be part of a table and may be quoted as such,
:func:`_expression.literal_column` can be that,
or any other arbitrary column-oriented
expression.

:param text: the text of the expression; can be any SQL expression.
  Quoting rules will not be applied. To specify a column-name expression
  which should be subject to quoting rules, use the :func:`column`
  function.

:param type\_: an optional :class:`~sqlalchemy.types.TypeEngine`
  object which will
  provide result-set translation and additional expression semantics for
  this column. If left as ``None`` the type will be :class:`.NullType`.

.. seealso::

    :func:`_expression.column`

    :func:`_expression.text`

    :ref:`tutorial_select_arbitrary_text`

T)rt   
is_literal)ColumnClause)textrt   s     rv   literal_columnr      s    F d;;ry   c                      \ rS rSrSrSrSrSrSr\	R                  " S5      \	R                  " S5        S       SS
 jj5       5       rS rSS jrSS jrSrg	)CompilerElement   zbbase class for SQL elements that can be compiled to produce a
SQL string.

.. versionadded:: 2.0

rq   compiler_elementFdefaultzsqlalchemy.engine.defaultzsqlalchemy.engine.urlNc                <   Uc  U(       a  UR                   nOsU R                  S:X  a  U R                  5       nOR[        R                  R
                  nUR                  R                  U R                  5      R                  5       " 5       nU R                  " U40 UD6$ )a  Compile this SQL expression.

The return value is a :class:`~.Compiled` object.
Calling ``str()`` or ``unicode()`` on the returned value will yield a
string representation of the result. The
:class:`~.Compiled` object also can return a
dictionary of bind parameter names and values
using the ``params`` accessor.

:param bind: An :class:`.Connection` or :class:`.Engine` which
   can provide a :class:`.Dialect` in order to generate a
   :class:`.Compiled` object.  If the ``bind`` and
   ``dialect`` parameters are both omitted, a default SQL compiler
   is used.

:param column_keys: Used for INSERT and UPDATE statements, a list of
    column names which should be present in the VALUES clause of the
    compiled statement. If ``None``, all columns from the target table
    object are rendered.

:param dialect: A :class:`.Dialect` instance which can generate
    a :class:`.Compiled` object.  This argument takes precedence over
    the ``bind`` argument.

:param compile_kwargs: optional dictionary of additional parameters
    that will be passed through to the compiler within all "visit"
    methods.  This allows any custom flag to be passed through to
    a custom compilation construct, for example.  It is also used
    for the case of passing the ``literal_binds`` flag through::

        from sqlalchemy.sql import table, column, select

        t = table("t", column("x"))

        s = select(t).where(t.c.x == 5)

        print(s.compile(compile_kwargs={"literal_binds": True}))

.. seealso::

    :ref:`faq_sql_expression_string`

r   )
dialectstringify_dialect_default_dialectr=   	preloaded
engine_urlURLcreateget_dialect	_compiler)selfbindr   kwurls        rv   compileCompilerElement.compile   s    h ?,,''94//1nn//''..**+-  " ~~g,,,ry   c                V    [         R                  R                  nUR                  5       $ rp   )r=   r   engine_defaultStrCompileDialect)r   r   s     rv   r    CompilerElement._default_dialect6  s     ..//((**ry   c                l    [         (       a  [        U [        5      (       d   eUR                  " X40 UD6$ )FReturn a compiler appropriate for this ClauseElement, given a
Dialect.)r   
isinstanceClauseElementstatement_compilerr   r   r   s      rv   r   CompilerElement._compiler:  s2     =dM2222))'>2>>ry   c                4    [        U R                  5       5      $ rp   )strr   r   s    rv   __str__CompilerElement.__str__B  s    4<<>""ry   NN)r   Optional[_HasDialect]r   Optional[Dialect]r   r   returnrM   )r   r_   r   r   r   rM   r   r   )__name__
__module____qualname____firstlineno____doc__	__slots____visit_name__supports_executionr   r=   preload_moduler   r   r   r   __static_attributes__rq   ry   rv   r   r      s     I'N!	45	01 '+%)=-#=- #=- 	=-
 
=- 2 6=-~+?#ry   r   c                     \ rS rSr% SrSr\(       a  \R                  S.S j5       r	O\R                  r	\R                  S/S j5       rSrS\S'   S	rS
rS
rS
rS
rS
rS
rS
rS
rS
rS
rS
rS
rS
rS
rS
rS
rS
r S
r!S
r"S
r#\$S0S j5       r%Sr&S\S'   S\S'   \'R                  (       a  SS.     S1S jjr(\RR                  S2S j5       r*S3S jr+S4S jr,S5S jr-S r.S r/\$S 5       r0\1Rd                  S 5       r3S r4\$S 5       r5S r6        S6S jr7        S7S jr8S8S  jr9 S9     S:S! jjr: S9     S;S" jjr;        S<S# jr<S=S$ jr= S9   S>S% jjr>S?S& jr?S
SS'.             S@S( jjr@S) rAS?S* jrBS+ rCS, rDS-rEg)Ar   iF  zKBase class for elements of a programmatically constructed SQL
expression.

clausec                    g)zlike annotations, however these propagate outwards liberally
as SQL constructs are built, and are set up at construction time.

Nrq   r   s    rv   _propagate_attrsClauseElement._propagate_attrsW  s     ry   c                    g rp   rq   r   s    rv   descriptionClauseElement.descriptionb      ry   NzOptional[Self]_is_clone_ofTFc                    g rp   rq   r   s    rv   _order_by_label_element%ClauseElement._order_by_label_element~  r   ry   rK   _cache_key_traversalColumnElement[bool]negation_clause.)
omit_attrsc                   g rp   rq   )r   r   r   s      rv   get_childrenClauseElement.get_children  s    &)ry   c                    / $ rp   rq   r   s    rv   _from_objectsClauseElement._from_objects      	ry   c                <    [         R                  " U5      U l        U $ rp   )r=   immutabledictr   )r   valuess     rv   _set_propagate_attrs"ClauseElement._set_propagate_attrs  s     !% 2 26 :ry   c                D    U R                  5       nUR                  X5      $ rp   )r   r   )r   r   s     rv   _default_compilerClauseElement._default_compiler  s!    '')))'88ry   c                   U R                   nU R                  R                  U R                  5      nU(       aJ  U R                  R	                  5       R                  5        VVs0 s H  u  pEXB;  d  M  XE_M     snnUl        OU R                  R	                  5       Ul        U R                  nUb  Xcl        U$ U Ul        U$ s  snnf )zCreate a shallow copy of this ClauseElement.

This method may be used by a generative API.  Its also used as
part of the "deep" copy afforded by a traversal that combines
the _copy_internals() method.

)_memoized_keys	__class____new____dict__copyitemsr   )r   r   skipckvccs          rv   r&   ClauseElement._clone  s     ""NN""4>>2 "&!3!3!5!;!;!=!=!=AJ ++-AJ !~ 48s   $C3Cc                    U $ )za hook to allow the right side of a binary expression to respond
to a negation of the binary expression.

Used for the special case of expanding bind parameter with IN.

rq   )r   
negated_oporiginal_ops      rv   _negate_in_binaryClauseElement._negate_in_binary  	     ry   c                    U $ )zin the context of binary expression, convert the type of this
object to the one given.

applies only to :class:`_expression.ColumnElement` classes.

rq   r   rt   s     rv   _with_binary_element_type'ClauseElement._with_binary_element_type  r   ry   c                    U R                   $ )a  return the 'constructor' for this ClauseElement.

This is for the purposes for creating a new object of
this type.   Usually, its just the element's __class__.
However, the "Annotated" version of the object overrides
to return the class of its proxied element.

r   r   s    rv   _constructorClauseElement._constructor  s     ~~ry   c                ~    [         R                  " 5       nU nUb"  UR                  U5        UR                  nUb  M"  U$ )zReturn the set consisting all cloned ancestors of this
ClauseElement.

Includes this ClauseElement.  This accessor tends to be used for
FromClause objects to identify 'equivalent' FROM clauses, regardless
of transformative operations.

)r=   
column_setaddr   )r   sfs      rv   _cloned_setClauseElement._cloned_set  s>     OO%) mEE!HA m ry   c                V    U R                   b  U R                   n U R                   b  M  U $ rp   )r   r   s    rv   	_de_cloneClauseElement._de_clone  s,    +$$D +ry   c                    [        S5      e)NzFThis SQL expression has no entity namespace with which to filter from.)AttributeErrorr   s    rv   entity_namespaceClauseElement.entity_namespace  s    )
 	
ry   c                    U R                   R                  5       nUR                  SS 5        UR                  SS 5        U$ )Nr   _generate_cache_key)r   r   pop)r   ds     rv   __getstate__ClauseElement.__getstate__  s6    MM 	nd#	#T*ry   c                    U R                   (       a4  [        (       a  [        U [        5      (       d   eUR	                  XU5      $ [
        R                  " U 5      erp   )r   r   r   r*   _execute_clauseelementr;   ObjectNotExecutableErrorr   
connectiondistilled_paramsexecution_optionss       rv   _execute_on_connection$ClauseElement._execute_on_connection  sQ     ""}!$
333344(9  ..t44ry   c                B    U R                  XU5      R                  5       $ )zan additional hook for subclasses to provide a different
implementation for connection.scalar() vs. connection.execute().

.. versionadded:: 2.0

)r  scalarr
  s       rv   _execute_on_scalar ClauseElement._execute_on_scalar  s$     ***;

&(	ry   c                z    U R                  5       nUc  / n[        U 0 SUR                  05        U$ UR                  $ )aS  Return the list of :class:`.BindParameter` objects embedded in the
object.

This accomplishes the same purpose as ``visitors.traverse()`` or
similar would provide, however by making use of the cache key
it takes advantage of memoization of the key to result in fewer
net method calls, assuming the statement is also going to be
executed.

	bindparam)r  r8   append
bindparams)r   keyr  s      rv   _get_embedded_bindparams&ClauseElement._get_embedded_bindparams!  sE     &&(;35JT2Z->->?@ >>!ry   c                &    U R                  SX5      $ )zReturn a copy with :func:`_expression.bindparam` elements
replaced.

Same functionality as :meth:`_expression.ClauseElement.params`,
except adds `unique=True`
to affected bind parameters so that multiple statements can be
used.

T_replace_paramsr   _ClauseElement__optionaldictkwargss      rv   unique_paramsClauseElement.unique_params7  s     ##D.AAry   c                &    U R                  SX5      $ )au  Return a copy with :func:`_expression.bindparam` elements
replaced.

Returns a copy of this ClauseElement with
:func:`_expression.bindparam`
elements replaced with values taken from the given dictionary::

  >>> clause = column("x") + bindparam("foo")
  >>> print(clause.compile().params)
  {'foo':None}
  >>> print(clause.params({"foo": 7}).compile().params)
  {'foo':7}

Fr  r  s      rv   paramsClauseElement.paramsG  s    & ##E>BBry   c                l   ^^ U(       a  TR                  U5        SUU4S jjn[        U SSS.SU05      $ )Nc                   > U R                   T;   a  TU R                      U l        SU l        T(       a  U R                  5         g g NF)r  rs   required_convert_to_unique)r   r   uniques    rv   visit_bindparam6ClauseElement._replace_params.<locals>.visit_bindparame  s:    xx6!#DHH-
 %'') ry   T)maintain_keydetect_subquery_colsr  )r   BindParameter[Any]r   None)updater5   )r   r+  optionaldictr   r,  s    ` ` rv   r  ClauseElement._replace_params\  s@     MM,'	* 	* !4@/*
 	
ry   c                0    [         R                  " X40 UD6$ )a]  Compare this :class:`_expression.ClauseElement` to
the given :class:`_expression.ClauseElement`.

Subclasses should override the default behavior, which is a
straight identity comparison.

\**kw are arguments consumed by subclass ``compare()`` methods and
may be used to modify the criteria for comparison
(see :class:`_expression.ColumnElement`).

)r   comparer   otherr   s      rv   r6  ClauseElement.comparer  s     !!$444ry   c                    U $ )a   Apply a 'grouping' to this :class:`_expression.ClauseElement`.

This method is overridden by subclasses to return a "grouping"
construct, i.e. parenthesis.   In particular it's used by "binary"
expressions to provide a grouping around themselves when placed into a
larger expression, as well as by :func:`_expression.select`
constructs when placed into the FROM clause of another
:func:`_expression.select`.  (Note that subqueries should be
normally created using the :meth:`_expression.Select.alias` method,
as many
platforms require nested SELECT statements to be named).

As expressions are composed together, the application of
:meth:`self_group` is automatic - end-user code should never
need to use this method directly.  Note that SQLAlchemy's
clause constructs take operator precedence into account -
so parenthesis might not be needed, for example, in
an expression like ``x OR (y AND z)`` - AND takes precedence
over OR.

The base :meth:`self_group` method of
:class:`_expression.ClauseElement`
just returns self.
rq   r   againsts     rv   
self_groupClauseElement.self_group  s	    6 ry   c                    U $ )zFReturn this :class:`_expression.ClauseElement`
without any groupings.
rq   r   s    rv   _ungroupClauseElement._ungroup  s	    
 ry   )for_executemanyschema_translate_mapc                  Ub"  UR                   (       a  U R                  5       nOS nUbw  [        (       a  Uc   eUu  pUU[        U5      [	        U5      U4n
UR                  U
5      nUc)  UR                  nU R                  " U4UUUUS.UD6nXU
'   OaUR                  nOTS n	U R                  " U4UUUUS.UD6nUR                   (       d  UR                  nOUc  UR                  nOUR                  nXU4$ )N)	cache_keycolumn_keysrB  rC  )_supports_statement_cacher  r   tupleboolget
CACHE_MISSr   	CACHE_HITNO_DIALECT_SUPPORTCACHING_DISABLEDNO_CACHE_KEY)r   r   compiled_cacherF  rB  rC  r   elem_cache_keyrE  extracted_paramsr  compiled_sql	cache_hits                rv   _compile_w_cacheClauseElement._compile_w_cache  s8    %'*K*K!557N!N%}%111*8'Ik")*C *--c2L##..	#~~ , +$3)=    '3s##--	#>>(' /%9 L 44#66	'#44	#00	y88ry   c                \    [        U S5      (       a  U R                  $ U R                  5       $ )Nr   )hasattrr   _negater   s    rv   
__invert__ClauseElement.__invert__  s*     4*++'''<<>!ry   c                    U R                  [        R                  S9n[        U[        5      (       d   e[        U[        R                  S9$ )Nr<  )operatorr=  r   invr   ColumnElementUnaryExpressionr   groupeds     rv   rY  ClauseElement._negate  s:    //)--/8'=1111w??ry   c                    [        S5      e)N+Boolean value of this clause is not defined)	TypeErrorr   s    rv   __bool__ClauseElement.__bool__  s    EFFry   c                    U R                   nUc  [        R                  U 5      $ SU R                  U R                  R
                  [        U 5      U4-  $ )Nz<%s.%s at 0x%x; %s>)r   object__repr__r   r   r   id)r   friendlys     rv   rm  ClauseElement.__repr__  sR    ##??4(((''4	,  ry   )r   r   rH   r   Optional[str]r   zOptional[Label[Any]])r   ztyping_Tuple[str, ...]r   r   r   zIterable[ClauseElement]r   zList[FromClause])r   Mapping[str, Any]r   rB   )r   rN   )r   r   r   rB   )r  r^   r  r`   r  rc   r   zResult[Any])r  r^   r  r`   r  rc   r   r   )r   Sequence[BindParameter[Any]]rp   )r  zOptional[Dict[str, Any]]r   r   r   rB   )r  Optional[Mapping[str, Any]]r   r   r   rB   )r+  rI  r3  rx  r   zDict[str, Any]r   rB   )r8  r   r   r   r   rI  )r<  Optional[OperatorType]r   r   )r   r   )r   r_   rP  zOptional[CompiledCacheType]rF  z	List[str]rB  rI  rC  z Optional[SchemaTranslateMapType]r   r   r   zJtyping_Tuple[Compiled, Optional[Sequence[BindParameter[Any]]], CacheStats])Fr   r   r   r   r   r   r   r=   memoized_propertyr   
EMPTY_DICTro_memoized_propertyr   r   __annotations__is_clause_elementis_selectableis_dml_is_column_element_is_keyed_column_element	_is_table!_gen_static_annotations_cache_key_is_textual_is_from_clause_is_returns_rows_is_text_clause_is_from_container_is_select_container_is_select_base_is_select_statement_is_bind_parameter_is_clause_list_is_lambda_element_is_singleton_constant_is_immutable_is_starpropertyr   r   typingr   ro_non_memoized_propertyr   r   r   r&   r   r   r   r,   memoized_attributer   r   r   r  r  r  r  r!  r$  r  r6  r=  r@  rU  rZ  rY  ri  rm  r   rq   ry   rv   r   r   F  s   
 N				 
 	  ??	  $(L.'MF$I(-%KOO O O"MH  4807(( ;>	*!7	*EH	*$	* 
"" #9: 	 	 ## $,
 
 
55 25 7	5
 
5 2 7	
 
 "0 48B0B B 
	B$ 7;C3C C 
	C*

 2
 	

 

,5 15-	: !&AE@9@9 4	@9
 @9 @9 ?@9 @9
@9D"@
G
ry   r   c                  j    \ rS rSrSr\R                  (       a  SS jr  S       S	S jjrSr	gSr	g)
DQLDMLClauseElementi  zprepresents a :class:`.ClauseElement` that compiles to a DQL or DML
expression, not DDL.

.. versionadded:: 2.0

c                    g)r   Nrq   r   s      rv   r   DQLDMLClauseElement._compiler  s     ry   Nc                    g rp   rq   )r   r   r   r   s       rv   r   DQLDMLClauseElement.compile  s    
 ry   rq   )r   r_   r   r   r   rN   r   )r   r   r   r   r   r   r   rN   )
r   r   r   r   r   r  r   r   r   r   rq   ry   rv   r  r    sT     	 +/)-	'	 '	 		
 	 	 ry   r  c                  8    \ rS rSrSrSr\R                  rSr	Sr
g)CompilerColumnElementi  z\A compiler-only column element used for ad-hoc string compilations.

.. versionadded:: 2.0

rq   FN)r   r   r   r   r   r   r=   r{  r   _is_collection_aggregater   rq   ry   rv   r  r    s     I$ry   r  c                     \ rS rSrSr\R                  (       Ga  \R                  SpS j5       r	        SqS jr
        SqS jr\  SrSS.           SsS jjj5       r\    St           SuS	 jj5       r    Sv           SuS
 jjr  Sw       SxS jjrSyS jrSyS jrSzS jrS{S jrS{S jrS|S jrS{S jrS{S jrS{S jrS{S jrS{S jrS{S jrS}S jrS{S jrS~S jr\SS j5       r\SS j5       rSS jr\SS j5       r\SS j5       rSS  jr\SS! j5       r \SS" j5       r SS# jr  S     SS$ jjr! S     SS% jjr"SS& jr#SS' jr$SS( jr%S}S) jr&SS* jr'SS+ jr(    SS, jr)    SS- jr*    SS. jr+ S     SS/ jjr, S     SS0 jjr- S     SS1 jjr. S     SS2 jjr/SS3 jr0SS4 jr1SS5 jr2  S       SS6 jjr3  S       SS7 jjr4  S       SS8 jjr5  S       SS9 jjr6SS: jr7SS; jr8SS< jr9 S     SS= jjr: S       SS> jjr;S}S? jr<S}S@ jr=S}SA jr>S}SB jr?S}SC jr@S}SD jrASSE jrB S       SSF jjrCSSG jrDSSH jrESSI jrF\      SSJ j5       rG\      SSK j5       rG\SSL j5       rGSSM jrG\SSN j5       rH\SSO j5       rHSSP jrH\      SSQ j5       rI\SSR j5       rISSS jrI\      SST j5       rJ\SSU j5       rJSSV jrJ\      SSW j5       rK\SSX j5       rKSSY jrK\      SSZ j5       rL\SS[ j5       rLSS\ jrL\SS] j5       rM\SS^ j5       rMSS_ jrM\SS` j5       rN\SSa j5       rNSSb jrN\      SSc j5       rO\SSd j5       rO\SSe j5       rOSSf jrO\      SSg j5       rP\SSh j5       rPSSi jrP\      SSj j5       rQ\SSk j5       rQSSl jrQ\      SSm j5       rR\SSn j5       rRSSo jrRSrSgSrSg)SQLCoreOperationsi/  rq   c                    g rp   rq   r   s    rv   r   "SQLCoreOperations._propagate_attrs7  s    ;>ry   c                    g rp   rq   r   opr8  r   s       rv   operateSQLCoreOperations.operate:      !$ry   c                    g rp   rq   r  s       rv   reverse_operate!SQLCoreOperations.reverse_operate>  r  ry   N)python_implc                   g rp   rq   r   opstring
precedenceis_comparisonreturn_typer  s         rv   r  SQLCoreOperations.opB  s     7:ry   c                    g rp   rq   r  s         rv   r  r  M  s     69ry   c                    g rp   rq   r  s         rv   r  r  W  s     69ry   c                    g rp   rq   )r   r  r  r  s       rv   bool_opSQLCoreOperations.bool_op`  s    
 7:ry   c                    g rp   rq   r   r8  s     rv   __and__SQLCoreOperations.__and__g      Cry   c                    g rp   rq   r  s     rv   __or__SQLCoreOperations.__or__i  s    3ry   c                    g rp   rq   r   s    rv   rZ  SQLCoreOperations.__invert__k  s    cry   c                    g rp   rq   r  s     rv   __lt__SQLCoreOperations.__lt__m      Sry   c                    g rp   rq   r  s     rv   __le__SQLCoreOperations.__le__o  r  ry   c                    g rp   rq   r   s    rv   __hash__SQLCoreOperations.__hash__u  s    3ry   c                    g rp   rq   r  s     rv   __eq__SQLCoreOperations.__eq__w      ry   c                    g rp   rq   r  s     rv   __ne__SQLCoreOperations.__ne__z  r  ry   c                    g rp   rq   r  s     rv   is_distinct_from"SQLCoreOperations.is_distinct_from}      sry   c                    g rp   rq   r  s     rv   is_not_distinct_from&SQLCoreOperations.is_not_distinct_from      3ry   c                    g rp   rq   r  s     rv   __gt__SQLCoreOperations.__gt__  r  ry   c                    g rp   rq   r  s     rv   __ge__SQLCoreOperations.__ge__  r  ry   c                    g rp   rq   r   s    rv   __neg__SQLCoreOperations.__neg__  s    Sry   c                    g rp   rq   r  s     rv   __contains__SQLCoreOperations.__contains__      3ry   c                    g rp   rq   )r   indexs     rv   __getitem__SQLCoreOperations.__getitem__      ry   c                    g rp   rq   r  s     rv   
__lshift__SQLCoreOperations.__lshift__      KNry   c                    g rp   rq   r  s     rv   r  r        @Cry   c                    g rp   rq   r  s     rv   r  r        ry   c                    g rp   rq   r  s     rv   
__rshift__SQLCoreOperations.__rshift__  r  ry   c                    g rp   rq   r  s     rv   r  r    r  ry   c                    g rp   rq   r  s     rv   r  r    r  ry   c                    g rp   rq   r  s     rv   concatSQLCoreOperations.concat  s    GJry   c                    g rp   rq   r  s     rv   r  r    s    <?ry   c                    g rp   rq   r  s     rv   r  r    r  ry   c                    g rp   rq   r   r8  escapes      rv   likeSQLCoreOperations.like      %(ry   c                    g rp   rq   r  s      rv   ilikeSQLCoreOperations.ilike  r  ry   c                    g rp   rq   r  s     rv   bitwise_xorSQLCoreOperations.bitwise_xor      Cry   c                    g rp   rq   r  s     rv   
bitwise_orSQLCoreOperations.bitwise_or  r  ry   c                    g rp   rq   r  s     rv   bitwise_andSQLCoreOperations.bitwise_and  r  ry   c                    g rp   rq   r   s    rv   bitwise_notSQLCoreOperations.bitwise_not      ry   c                    g rp   rq   r  s     rv   bitwise_lshift SQLCoreOperations.bitwise_lshift  r  ry   c                    g rp   rq   r  s     rv   bitwise_rshift SQLCoreOperations.bitwise_rshift  r  ry   c                    g rp   rq   r  s     rv   in_SQLCoreOperations.in_      
 &)ry   c                    g rp   rq   r  s     rv   not_inSQLCoreOperations.not_in  r!  ry   c                    g rp   rq   r  s     rv   notin_SQLCoreOperations.notin_  r!  ry   c                    g rp   rq   r  s      rv   not_likeSQLCoreOperations.not_like  r  ry   c                    g rp   rq   r  s      rv   notlikeSQLCoreOperations.notlike  r  ry   c                    g rp   rq   r  s      rv   	not_ilikeSQLCoreOperations.not_ilike  r  ry   c                    g rp   rq   r  s      rv   notilikeSQLCoreOperations.notilike  r  ry   c                    g rp   rq   r  s     rv   is_SQLCoreOperations.is_  r  ry   c                    g rp   rq   r  s     rv   is_notSQLCoreOperations.is_not  r  ry   c                    g rp   rq   r  s     rv   isnotSQLCoreOperations.isnot  s    sry   c                    g rp   rq   r   r8  r  
autoescapes       rv   
startswithSQLCoreOperations.startswith      
 #&ry   c                    g rp   rq   r>  s       rv   istartswithSQLCoreOperations.istartswith  rB  ry   c                    g rp   rq   r>  s       rv   endswithSQLCoreOperations.endswith  rB  ry   c                    g rp   rq   r>  s       rv   	iendswithSQLCoreOperations.iendswith  rB  ry   c                    g rp   rq   r7  s      rv   containsSQLCoreOperations.contains  s    #ry   c                    g rp   rq   r7  s      rv   	icontainsSQLCoreOperations.icontains   r  ry   c                    g rp   rq   )r   r8  r   s      rv   matchSQLCoreOperations.match  r  ry   c                    g rp   rq   )r   patternflagss      rv   regexp_matchSQLCoreOperations.regexp_match  s    "%ry   c                    g rp   rq   )r   rV  replacementrW  s       rv   regexp_replace SQLCoreOperations.regexp_replace  r  ry   c                    g rp   rq   r   s    rv   descSQLCoreOperations.desc  s    #ry   c                    g rp   rq   r   s    rv   ascSQLCoreOperations.asc  s    ry   c                    g rp   rq   r   s    rv   nulls_firstSQLCoreOperations.nulls_first  r  ry   c                    g rp   rq   r   s    rv   
nullsfirstSQLCoreOperations.nullsfirst      ry   c                    g rp   rq   r   s    rv   
nulls_lastSQLCoreOperations.nulls_last  rj  ry   c                    g rp   rq   r   s    rv   	nullslastSQLCoreOperations.nullslast  s    sry   c                    g rp   rq   r   	collations     rv   collateSQLCoreOperations.collate      cry   c                    g rp   rq   )r   cleftcright	symmetrics       rv   betweenSQLCoreOperations.between  r  ry   c                    g rp   rq   r   s    rv   distinctSQLCoreOperations.distinct  r  ry   c                    g rp   rq   r   s    rv   any_SQLCoreOperations.any_       Cry   c                    g rp   rq   r   s    rv   all_SQLCoreOperations.all_"  r  ry   c                    g rp   rq   r  s     rv   __add__SQLCoreOperations.__add__)       #&ry   c                    g rp   rq   r  s     rv   r  r  /  s     "%ry   c                    g rp   rq   r  s     rv   r  r  5      =@ry   c                    g rp   rq   r  s     rv   r  r  8  r  ry   c                    g rp   rq   r  s     rv   __radd__SQLCoreOperations.__radd__:  r  ry   c                    g rp   rq   r  s     rv   r  r  =  s    ILry   c                    g rp   rq   r  s     rv   r  r  @  rv  ry   c                    g rp   rq   r  s     rv   __sub__SQLCoreOperations.__sub__B  r  ry   c                    g rp   rq   r  s     rv   r  r  H  r  ry   c                    g rp   rq   r  s     rv   r  r  K  r  ry   c                    g rp   rq   r  s     rv   __rsub__SQLCoreOperations.__rsub__M  r  ry   c                    g rp   rq   r  s     rv   r  r  S      >Ary   c                    g rp   rq   r  s     rv   r  r  V  rv  ry   c                    g rp   rq   r  s     rv   __mul__SQLCoreOperations.__mul__X  r  ry   c                    g rp   rq   r  s     rv   r  r  ^  r  ry   c                    g rp   rq   r  s     rv   r  r  a  r  ry   c                    g rp   rq   r  s     rv   __rmul__SQLCoreOperations.__rmul__c  r  ry   c                    g rp   rq   r  s     rv   r  r  i  r  ry   c                    g rp   rq   r  s     rv   r  r  l  rv  ry   c                    g rp   rq   r  s     rv   __mod__SQLCoreOperations.__mod__n  s    JMry   c                    g rp   rq   r  s     rv   r  r  q  r  ry   c                    g rp   rq   r  s     rv   r  r  t  r  ry   c                    g rp   rq   r  s     rv   __rmod__SQLCoreOperations.__rmod__v  r  ry   c                    g rp   rq   r  s     rv   r  r  y  r  ry   c                    g rp   rq   r  s     rv   r  r  |  rv  ry   c                    g rp   rq   r  s     rv   __truediv__SQLCoreOperations.__truediv__~       '*ry   c                    g rp   rq   r  s     rv   r  r    s    LOry   c                    g rp   rq   r  s     rv   r  r    s    ADry   c                    g rp   rq   r  s     rv   r  r    r  ry   c                    g rp   rq   r  s     rv   __rtruediv__SQLCoreOperations.__rtruediv__  r  ry   c                    g rp   rq   r  s     rv   r  r        BEry   c                    g rp   rq   r  s     rv   r  r        #ry   c                    g rp   rq   r  s     rv   __floordiv__SQLCoreOperations.__floordiv__       #&ry   c                    g rp   rq   r  s     rv   r  r    r  ry   c                    g rp   rq   r  s     rv   r  r    r  ry   c                    g rp   rq   r  s     rv   __rfloordiv__SQLCoreOperations.__rfloordiv__  r  ry   c                    g rp   rq   r  s     rv   r  r        CFry   c                    g rp   rq   r  s     rv   r  r    r  ry   rq  )r  rP   r8  r   r   r   r   ColumnElement[Any])..)r  r   r  intr  rI  r  _TypeEngineArgument[_OPT]r  Optional[Callable[..., Any]]r   z'Callable[[Any], BinaryExpression[_OPT]])....)r  r   r  r  r  rI  r  "Optional[_TypeEngineArgument[Any]]r  r  r   z&Callable[[Any], BinaryExpression[Any]])r   FNN)r   N)r  r   r  r  r  r  r   z'Callable[[Any], BinaryExpression[bool]])r8  r   r   BooleanClauseList)r   zColumnElement[_T_co])r8  r   r   r   r   r  )r   UnaryExpression[_T_co])r  r   r   r  )r   	_SQO[int]r8  r   r   zColumnElement[int])r8  r   r   r  )r   z	_SQO[str]r8  r   r   ColumnElement[str]rp   )r8  r   r  rs  r   BinaryExpression[bool])r8  r   r   zBinaryExpression[Any])r8  z=Union[Iterable[Any], BindParameter[Any], roles.InElementRole]r   r  )r8  r   r   r  r(  )r8  r   r  rs  r?  rI  r   r   )r8  r   r   r   r   r   )r8  r   r   r   r   r   )rV  r   rW  rs  r   r   )rV  r   r[  r   rW  rs  r   r  )rs  r   r   CollationClauseF)rx  r   ry  r   rz  rI  r   r  )r   z_SQO[_T_co]r   r  )r   zCollectionAggregate[Any])r   
_SQO[_NMT]r8  r   r   zColumnElement[_NMT])r   r  r8  r   r   ColumnElement[_NUMERIC])r   z	_SQO[_NT]r8  r   r   zColumnElement[_NT])r   r  r8  r   r   r  )Tr   r   r   r   r   r  r   r=   non_memoized_propertyr   r  r  r   r  r  r  r  rZ  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r#  r&  r)  r,  r/  r2  r5  r8  r;  r@  rD  rG  rJ  rM  rP  rS  rX  r\  r_  rb  re  rh  rl  ro  rt  r{  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   rq   ry   rv   r  r  /  s   I
 		#	#> 
$>	%"	%,/	%;>	%	%	%"	%+.	%:=	%	% 
 ""%		: 9=	:	: 	:  		: 3	: 6	: 5	: 
	: 
 ""%>A8;	9	9 	9  		9
 <	9 6	9 4	9 
	9  "'>B8<	9	9 	9  		9
 <	9 6	9 4	9  8<		:	: 	: 6		:
 5	: 	@>9@@ 	'		 	KN@@8FD	N 
N	C 
CC	N 
N	C 
CC	J 
J	? 
?? 7;	)	)&3	)#	)
 7;	)	)&3	)#	) 	HFG<JJ	)	)
 $	)	)	)
 $	)	)	)
 $	) 7;	)	)&3	)#	)
 7;	)	)&3	)#	)
 7;	)	)&3	)#	)
 7;	)	)&3	)#	) 	ACB
 %)$		&	& "	& 		&
 !	& %)$		&	& "	& 		&
 !	& %)$		&	& "	& 		&
 !	& %)$		&	& "	& 		&
 !	& 	NNN 8<	&	&'4	& 	&
 JN	%	%-0	%9F	%	% 	64<;;:A >C	)	)&)	)6:	)#	) 	G77 
	&	&	& !	& 
	&
 
	%	%	%  	% 
	%
 
@ 
@@	N 
N	L 
LA		&	&	& !	& 
	&
 
@ 
@@		&	&	& !	& 
	&
 
A 
AA		&	&	& !	& 
	&
 
@ 
@@		&	&	& !	& 
	&
 
A 
AA	M 
M	@ 
@@	N 
N	A 
AA		*	*$'	*$	* 
	* 
O 
O	D 
DD		*	*%(	*$	* 
	* 
E 
EE		&	&%(	& 	& 
	& 
E 
EE		&	&%(	& 	& 
	& 
F 
FFe ry   r  c                      \ rS rSrSrSrSrg)SQLColumnExpressioni  a  A type that may be used to indicate any SQL column element or object
that acts in place of one.

:class:`.SQLColumnExpression` is a base of
:class:`.ColumnElement`, as well as within the bases of ORM elements
such as :class:`.InstrumentedAttribute`, and may be used in :pep:`484`
typing to indicate arguments or return values that should behave
as column expressions.

.. versionadded:: 2.0.0b4


rq   Nr   r   r   r   r   r   r   rq   ry   rv   r  r    s     Iry   r  c                  D   \ rS rSr% SrSrSrS\S'   S\S'   S	rSr	S\S
'   Sr
Sr\" 5       rS\S'   \R                  SBS j5       r\R"                  SCS j5       rSrS\S'    \R*                  SCS j5       r\SCS j5       r\SCS j5       r\SCS j5       rS	r S	r SrSrS\S'   \SDSES jj5       r \ SD   SFS jj5       r  SD   SFS jjr \SGS j5       r!\SHS j5       r!SIS jr!S\S '   \"(       d  \R                  SJS! j5       r#\R*                  SKS" j5       r$S# r%SLS$ jr&        SMS% jr'        SMS& jr(  SN         SOS' jjr)\SIS( j5       r*\SPS) j5       r+\R                  SQS* j5       r,\R                  SQS+ j5       r-\R                  SQS, j5       r.SBS- jr/SRS. jr0SSS/ jr1\R*                  SCS0 j5       r2\R*                  SCS1 j5       r3SSSSS2.                 STS3 jjr4SUS4 jr5SVS5 jr6 SD     SWS6 jjr7\R                  SXS7 j5       r8\R                  SYS8 j5       r9\\Rt                  " S9S:5      SXS; j5       5       r;\\Rt                  " S9S<5      SXS= j5       5       r<SZS> jr=\R                  SYS? j5       r>\R                  SYS@ j5       r?S[SA jr@SrAg)\ra  i  a  Represent a column-oriented SQL expression suitable for usage in the
"columns" clause, WHERE clause etc. of a statement.

While the most familiar kind of :class:`_expression.ColumnElement` is the
:class:`_schema.Column` object, :class:`_expression.ColumnElement`
serves as the basis
for any unit that may be present in a SQL expression, including
the expressions themselves, SQL functions, bound parameters,
literal expressions, keywords such as ``NULL``, etc.
:class:`_expression.ColumnElement`
is the ultimate base class for all such elements.

A wide variety of SQLAlchemy Core functions work at the SQL expression
level, and are intended to accept instances of
:class:`_expression.ColumnElement` as
arguments.  These functions will typically document that they accept a
"SQL expression" as an argument.  What this means in terms of SQLAlchemy
usually refers to an input which is either already in the form of a
:class:`_expression.ColumnElement` object,
or a value which can be **coerced** into
one.  The coercion rules followed by most, but not all, SQLAlchemy Core
functions with regards to SQL expressions are as follows:

    * a literal Python value, such as a string, integer or floating
      point value, boolean, datetime, ``Decimal`` object, or virtually
      any other Python object, will be coerced into a "literal bound
      value".  This generally means that a :func:`.bindparam` will be
      produced featuring the given value embedded into the construct; the
      resulting :class:`.BindParameter` object is an instance of
      :class:`_expression.ColumnElement`.
      The Python value will ultimately be sent
      to the DBAPI at execution time as a parameterized argument to the
      ``execute()`` or ``executemany()`` methods, after SQLAlchemy
      type-specific converters (e.g. those provided by any associated
      :class:`.TypeEngine` objects) are applied to the value.

    * any special object value, typically ORM-level constructs, which
      feature an accessor called ``__clause_element__()``.  The Core
      expression system looks for this method when an object of otherwise
      unknown type is passed to a function that is looking to coerce the
      argument into a :class:`_expression.ColumnElement` and sometimes a
      :class:`_expression.SelectBase` expression.
      It is used within the ORM to
      convert from ORM-specific objects like mapped classes and
      mapped attributes into Core expression objects.

    * The Python ``None`` value is typically interpreted as ``NULL``,
      which in SQLAlchemy Core produces an instance of :func:`.null`.

A :class:`_expression.ColumnElement` provides the ability to generate new
:class:`_expression.ColumnElement`
objects using Python expressions.  This means that Python operators
such as ``==``, ``!=`` and ``<`` are overloaded to mimic SQL operations,
and allow the instantiation of further :class:`_expression.ColumnElement`
instances
which are composed from other, more fundamental
:class:`_expression.ColumnElement`
objects.  For example, two :class:`.ColumnClause` objects can be added
together with the addition operator ``+`` to produce
a :class:`.BinaryExpression`.
Both :class:`.ColumnClause` and :class:`.BinaryExpression` are subclasses
of :class:`_expression.ColumnElement`:

.. sourcecode:: pycon+sql

    >>> from sqlalchemy.sql import column
    >>> column("a") + column("b")
    <sqlalchemy.sql.expression.BinaryExpression object at 0x101029dd0>
    >>> print(column("a") + column("b"))
    {printsql}a + b

.. seealso::

    :class:`_schema.Column`

    :func:`_expression.column`

column_elementFrI  primary_keyOptional[ColumnElement[_T]]r   T_insert_sentinelzAbstractSet[ForeignKey]foreign_keysc                    / $ rp   rq   r   s    rv   _proxiesColumnElement._proxies)  r   ry   rs  c                    g)a-  The named label that can be used to target
this column in a result set in a "table qualified" context.

This label is almost always the label used when
rendering <expr> AS <label> in a SELECT statement when using
the LABEL_STYLE_TABLENAME_PLUS_COL label style, which is what the
legacy ORM ``Query`` object uses as well.

For a regular Column bound to a Table, this is typically the label
<tablename>_<columnname>.  For other constructs, different rules
may apply, such as anonymized labels and others.

.. versionchanged:: 1.4.21 renamed from ``._label``

Nrq   r   s    rv   	_tq_labelColumnElement._tq_label-  s    " ry   Nr  c                    U R                   $ )a$  A label-based version of 'key' that in some circumstances refers
to this object in a Python namespace.


_tq_key_label comes into play when a select() statement is constructed
with apply_labels(); in this case, all Column objects in the ``.c``
collection are rendered as <tablename>_<columnname> in SQL; this is
essentially the value of ._label. But to locate those columns in the
``.c`` collection, the name is along the lines of <tablename>_<key>;
that's the typical value of .key_label.

.. versionchanged:: 1.4.21 renamed from ``._key_label``

)
_proxy_keyr   s    rv   _tq_key_labelColumnElement._tq_key_labelJ  s      ry   c                    U R                   $ )z legacy; renamed to _tq_key_label)r  r   s    rv   
_key_labelColumnElement._key_label\  s     !!!ry   c                    U R                   $ )zlegacy; renamed to _tq_labelr  r   s    rv   _labelColumnElement._labela  s     ~~ry   c                    [        U SS5      $ )a  the 'name' that naturally applies this element when rendered in
SQL.

Concretely, this is the "name" of a column or a label in a
SELECT statement; ``<columnname>`` and ``<labelname>`` below:

.. sourcecode:: sql

    SELECT <columnmame> FROM table

    SELECT column AS <labelname> FROM table

Above, the two names noted will be what's present in the DBAPI
``cursor.description`` as the names.

If this attribute returns ``None``, it means that the SQL element as
written does not have a 100% fully predictable "name" that would appear
in the ``cursor.description``. Examples include SQL functions, CAST
functions, etc. While such things do return names in
``cursor.description``, they are only predictable on a
database-specific basis; e.g. an expression like ``MAX(table.col)`` may
appear as the string ``max`` on one database (like PostgreSQL) or may
appear as the whole expression ``max(table.col)`` on SQLite.

The default implementation looks for a ``.name`` attribute on the
object, as has been the precedent established in SQLAlchemy for many
years.  An exception is made on the ``FunctionElement`` subclass
so that the return value is always ``None``.

.. versionadded:: 1.4.21



nameN)getattrr   s    rv   _non_anon_labelColumnElement._non_anon_labelf  s    H tVT**ry   rq   zSequence[str]
_alt_namesc                    g rp   rq   r;  s     rv   r=  ColumnElement.self_group  s    EHry   c                    g rp   rq   r;  s     rv   r=  r    s     !ry   c                ~   U[         R                  [         R                  [         R                  4;   aZ  U R                  R
                  [        R                  R
                  L a)  [        U [         R                  [         R                  5      $ U[         R                  [         R                  4;   a  [        U 5      $ U $ rp   )r   and_or__asbooltype_type_affinityr   BOOLEANTYPE	AsBooleanis_trueis_falseany_opall_opGroupingr;  s     rv   r=  r    s     		y7H7HII		((H,@,@,O,OOT9#4#4i6H6HII))9+;+;<<D>!Kry   c                    g rp   rq   r   s    rv   rY  ColumnElement._negate  r  ry   c                    g rp   rq   r   s    rv   rY  r    s    ?Bry   c                P   U R                   R                  [        R                  R                  L a)  [	        U [
        R                  [
        R                  5      $ U R                  [
        R                  S9n[        U[        5      (       d   e[        U[
        R                  SS9$ Nr]  T)r^  wraps_column_expression)r  r  r   r  r  r   r	  r  r=  r`  r   ra  rb  rc  s     rv   rY  r    sz    99##x';';'J'JJT9#5#5y7H7HIIooimmo<Gg}5555")-- ry   TypeEngine[_T]r  c                "    [         R                  $ rp   r   NULLTYPEr   s    rv   r  ColumnElement.type  s     $$$ry   c                     U R                   R                  nU" U 5      $ ! [         a  n[        SU R                   -  5      UeS nAff = f)NzOObject %r associated with '.type' attribute is not a TypeEngine class or object)r  comparator_factoryr   rh  )r   r  errs      rv   
comparatorColumnElement.comparator  sZ    	,!%!=!= &d++  	68<		B 	s     
AAAc                :    U R                   R                  U5        g rp   )r   r2  r   states     rv   __setstate__ColumnElement.__setstate__  s    U#ry   c           	          [        U R                  U5      $ ! [         aM  n[        S[        U 5      R                  < S[        U R                  5      R                  < SU< 35      UeS nAff = f)NzNeither z object nor z object has an attribute )r  r  r   r  r   )r   r  r  s      rv   __getattr__ColumnElement.__getattr__  sc    
	4??C00 	  J'')22	 	s    
A/AA**A/c                .    U" U R                   /UQ70 UD6$ rp   r  r  s       rv   r  ColumnElement.operate  s     $//4E4V44ry   c                (    U" X R                   40 UD6$ rp   r&  r  s       rv   r  ColumnElement.reverse_operate  s     %3F33ry   c           
     4    [        S UUUU R                  SUS9$ NT)_compared_to_operatorrt   _compared_to_typer+  	expandingBindParameterr  r   r^  objrt   r.  s        rv   _bind_paramColumnElement._bind_param  s*     "*"ii
 	
ry   c                    U $ )zNReturn a column expression.

Part of the inspection interface; returns self.

rq   r   s    rv   
expressionColumnElement.expression  r   ry   c                    U 4$ rp   rq   r   s    rv   _select_iterableColumnElement._select_iterable  	    wry   c                :    [        S U R                   5       5      $ )Nc              3  J   #    U  H  oR                   (       a  M  Uv   M     g 7frp   )r  .0r   s     rv   	<genexpr>-ColumnElement.base_columns.<locals>.<genexpr>  s     ENq**Ns   #	#)	frozenset	proxy_setr   s    rv   base_columnsColumnElement.base_columns  s    EDNNEEEry   c                    [        U R                  5       /5      R                  [        R                  " U R
                   Vs/ s H  oR                  PM     sn6 5      $ s  snf )a  set of all columns we are proxying

as of 2.0 this is explicitly deannotated columns.  previously it was
effectively deannotated columns but wasn't enforced.  annotated
columns should basically not go into sets if at all possible because
their hashing behavior is very non-performant.

)rB  _deannotateunion	itertoolschainr  rC  r   r   s     rv   rC  ColumnElement.proxy_set  sL     $**,-.44OO4==A=akk=AB
 	
As   Ac                >    [        [        U R                  5      5      $ rp   )rB  r'   rC  r   s    rv   _expanded_proxy_set!ColumnElement._expanded_proxy_set*  s    788ry   c           
         U /[        [        R                  " U R                   Vs/ s H  oR	                  5       PM     sn6 5      -   $ s  snf )zxAn 'uncached' version of proxy set.

This list includes annotated columns which perform very poorly in
set operations.

)listrI  rJ  r  _uncached_proxy_listrK  s     rv   rR  "ColumnElement._uncached_proxy_list.  sC     vOON1446NO
 
 	
Ns   A	c                ^    [        U R                  R                  UR                  5      5      $ )z}Return True if the given :class:`_expression.ColumnElement`
has a common ancestor to this :class:`_expression.ColumnElement`.)rI  rC  intersection)r   othercolumns     rv   shares_lineageColumnElement.shares_lineage:  s$     DNN//0E0EFGGry   c                    [        US5      =(       a,    [        U S5      =(       a    UR                  U R                  :H  $ )z`Return True if the given column element compares to this one
when targeting within a result row.r  )rX  r  r  s     rv   _compare_name_for_result&ColumnElement._compare_name_for_result@  s7    
 E6" (f%(

dii'	
ry   c                    U R                   (       a-  SU R                   ;   a  [        [        U R                   S   5      $ U R                  nU(       d  U R                  n[        U[        5      (       a  g U$ )N	proxy_key)_annotationsr	   r   r  r  r   _anonymous_labelr   r  s     rv   r  ColumnElement._proxy_keyJ  s_    0A0A!AT..{;<<xx
 ''Dd,--Kry   c                    [        U SS5      b  gU R                  (       a-  SU R                  ;   a  [        [        U R                  S   5      $ g)a4  a suggested label to use in the case that the column has no name,
which should be used if possible as the explicit 'AS <label>'
where this expression would normally have an anon label.

this is essentially mostly what _proxy_key does except it returns
None if the column has a normal name that can be used.

r  Nr]  )r  r^  r	   r   r   s    rv   _expression_labelColumnElement._expression_label\  sG     4&2;$2C2C#CT..{;<<ry   )r  r  name_is_truncatablecompound_select_colsc                  Uc  U R                   nUc  U R                  nOUnUc   e[        U(       a%  [        R                  " [
        R                  U5      OU[        U SS5      US9n	UR                  U	l        U(       a  [        U5      U	l
        OU /U	l
        UR                  b*  UR                  R                  R                  U5      U	l        XY4$ )zCreate a new :class:`_expression.ColumnElement` representing this
:class:`_expression.ColumnElement` as it appears in the select list of
a descending selectable.

Nr  )rt   _selectable)_anon_name_labelr  r   r   r}   r   TruncatedLabelRoler  r   rQ  r  r   columnsrJ  )
r   
selectabler  r  r  r  re  rf  r   cos
             rv   _make_proxyColumnElement._make_proxyn  s    " <((D{ooC+ '   !9!94@$-" 
 )9934BK&BK"".(55==AA#FBOwry   c                    [        X5      $ )zProduce a type cast, i.e. ``CAST(<expression> AS <type>)``.

This is a shortcut to the :func:`_expression.cast` function.

.. seealso::

    :ref:`tutorial_casts`

    :func:`_expression.cast`

    :func:`_expression.type_coerce`

)Castr   s     rv   r	   ColumnElement.cast  s     D  ry   c                .    [        XU R                  5      $ )zProduce a column label, i.e. ``<columnname> AS <name>``.

This is a shortcut to the :func:`_expression.label` function.

If 'name' is ``None``, an anonymous label name will be generated.

)Labelr  r`  s     rv   labelColumnElement.label  s     T++ry   c                B   U R                   b  U R                   n U R                   b  M  [        U 5      nU(       a  US:  d   eU(       d   eUS-  U-  nUS-   n[        U[        5      (       a  [        R	                  USUS9$ [        R	                  X1=(       d    S5      $ )Ni      _ )enclosing_labelanon)r   hashr   r_  safe_construct)r   seedadd_hash
hash_values       rv   _anon_labelColumnElement._anon_label  s     +$$D + $Z
 w'''K4$*h6J #:Dd,--#22B 3    ..z>6JJry   c                >    [        U SS5      nU R                  U5      $ )ag  Provides a constant 'anonymous label' for this ColumnElement.

This is a label() expression which will be named at compile time.
The same label() is returned each time ``anon_label`` is called so
that expressions can reference ``anon_label`` multiple times,
producing the same label name at compile time.

The compiler uses this function automatically at compile time
for expressions that are known to be 'unnamed' like binary
expressions and function calls.

.. versionchanged:: 1.4.9 - this attribute was not intended to be
   public and is renamed to _anon_name_label.  anon_name exists
   for backwards compat

r  Nr  r  r`  s     rv   ri  ColumnElement._anon_name_label  s#    $ tVT*%%ry   c                8    U R                  U R                  5      $ )a  Provides a constant 'anonymous key label' for this ColumnElement.

Compare to ``anon_label``, except that the "key" of the column,
if available, is used to generate the label.

This is used when a deduplicating key is placed into the columns
collection of a selectable.

.. versionchanged:: 1.4.9 - this attribute was not intended to be
   public and is renamed to _anon_key_label.  anon_key_label exists
   for backwards compat

)r  r  r   s    rv   _anon_key_labelColumnElement._anon_key_label  s     00ry   1.4zqThe :attr:`_expression.ColumnElement.anon_label` attribute is now private, and the public accessor is deprecated.c                    U R                   $ rp   )ri  r   s    rv   
anon_labelColumnElement.anon_label  s     $$$ry   zuThe :attr:`_expression.ColumnElement.anon_key_label` attribute is now private, and the public accessor is deprecated.c                    U R                   $ rp   )r  r   s    rv   anon_key_labelColumnElement.anon_key_label  s     ###ry   c                b    [        U SS5      nUc  U R                  U5      $ U R                  X!S9$ )a  label to apply to a column that is anon labeled, but repeated
in the SELECT, so that we have to make an "extra anon" label that
disambiguates it from the previous appearance.

these labels come out like "foo_bar_id__1" and have double underscores
in them.

r  Nr  )r  _dedupe_anon_tq_label_idxr  r   idxru  s      rv   _dedupe_anon_label_idx$ColumnElement._dedupe_anon_label_idx  s>     fd+ =11#66##E#88ry   c                :    U R                  [        U SS 5      5      $ Nr  r  r  r   s    rv   _anon_tq_labelColumnElement._anon_tq_label(  s    k4 @AAry   c                :    U R                  [        U SS 5      5      $ )Nr  r  r   s    rv   _anon_tq_key_label ColumnElement._anon_tq_key_label,  s    ot DEEry   c                L    [        U SS 5      =(       d    SnU R                  X!S9$ )Nr  r|  r  r  r  s      rv   r  'ColumnElement._dedupe_anon_tq_label_idx0  s)    k40:F44ry   r   List[ColumnElement[Any]]rr  rp   )r<  r1  r   ColumnElement[_T])r<  ry  r   r  )r   r   r   r   )r   r  r   r  )r   r  r   r  )r   zTypeEngine.Comparator[_T])r  r   r   r   )r  operators.OperatorTyper8  r   r   r   r   r  r(  )
r^  r  r2  r   rt   Optional[TypeEngine[_T]]r.  rI  r   BindParameter[_T]r   rU   )r   zFrozenSet[ColumnElement[Any]])rV  r  r   rI  )r8  r  r   rI  )rl  rV   r  rJ   r  Set[KeyedColumnElement[Any]]r  rs  r  rs  re  rI  rf  &Optional[Sequence[ColumnElement[Any]]]r   r   r   #typing_Tuple[str, ColumnClause[_T]])rt   r  r   z
Cast[_OPT])r  rs  r   	Label[_T])r  rs  r  zOptional[int]r   r_  r   )r   r_  r  r  r   r   )r  r  r   r_  )Br   r   r   r   r   r   r  r}  r  r  _omit_from_statementsr  rB  r  r=   rz  r  r  r  r  r,   r  r  r  r  r  r  _render_label_in_columns_clause_allow_label_resolve_is_implicitly_booleanr  r   r=  rY  r   r  r  r   r#  r  r  r3  r6  r9  rD  rC  rN  rR  rW  rZ  r  rc  rn  r	   ru  r  ri  r  
deprecatedr  r  r  r  r  r  r   rq   ry   rv   ra  ra    s   M^ &NK--"d"!$,5KL)7	  
  $ C ## $" " "   #+ #+J '+#   # "J"H H04!-!	! !
 15-	 F FB B 				% 
 	%
 ##	, $	,$5"5 5 	5
 
54(4144@C4	4 +/
(
 
 (	

 
 

"     
F F 

 
 
9 9

H
 ## $" ## $. #!$)GK++ 	+
 3+ + + "+ E+ + 
-+Z! , >B"K!"K-:"K	"KH 
& &( 
1 1  	__	:
% % 	__	>
$ $9. 
B B 
F F5ry   ra  c                  (    \ rS rSr% SrSrS\S'   Srg)KeyedColumnElementi6  z)ColumnElement where ``.key`` is non-None.Tr   r  rq   N)r   r   r   r   r   r  r}  r   rq   ry   rv   r  r  6  s    3#	Hry   r  c                     ^  \ rS rSrSr\SS j5       r\R                  SS j5       r	\SS j5       r
\SS j5       r\R                  SU 4S jj5       rSS jr\U 4S	 j5       rS
rU =r$ )WrapsColumnExpressioni>  zMixin that defines a :class:`_expression.ColumnElement`
as a wrapper with special
labeling behavior for an expression that already has a name.

.. versionadded:: 1.4

.. seealso::

    :ref:`change_4449`


c                    [        5       erp   NotImplementedErrorr   s    rv   wrapped_column_expression/WrapsColumnExpression.wrapped_column_expressionL  s    !##ry   c                V    U R                   n[        US5      (       a  UR                  $ g r  )r  rX  r  )r   wces     rv   r  WrapsColumnExpression._tq_labelP  s'    ,,3$$== ry   c                    U R                   $ rp   r  r   s    rv   r  WrapsColumnExpression._labelX  s    ~~ry   c                    g rp   rq   r   s    rv   r  %WrapsColumnExpression._non_anon_label\  r   ry   c                   > U R                   nUR                  (       d2  UR                  nU(       a  U$ [        US5      (       a  UR                  $ [
        TU ]  $ )Nri  )r  r  r  rX  ri  super)r   r  nalr   s      rv   ri  &WrapsColumnExpression._anon_name_label`  sQ    ,,
 ""%%C
011+++w''ry   c                    U R                   nUR                  nU(       a  U R                  US-   5      $ U R                  U5      $ )Nry  )r  r  r  r  )r   r  r  r  s       rv   r  ,WrapsColumnExpression._dedupe_anon_label_idxo  sA    ,,!!##C#I..11#66ry   c                j   > U R                   nUR                  (       d  UR                  $ [        TU ]  $ rp   )r  r  r  r  )r   r  r   s     rv   r   WrapsColumnExpression._proxy_keyw  s,    ,,"">>!w!!ry   rq   r   r  rr  r   r  )r   r   r   r   r   r  r  r=   r  r  r  r  ri  r  r  r   __classcell__r   s   @rv   r  r  >  s     $ $ 
       
(  (7 " "ry   r  c                     \ rS rSr% SrSrS\R                  4S\R                  4S\R                  4S\R                  4S\R                  4/rS	\S
'   S\S'   S\S'   S\S'   SrSrSrSr\R&                  SS\R&                  SSSSSSSS4                         SS jjrS\4S jr\SS j5       rS S jrS rS rS!S"S jjrS rS rS rS rS r Sr!g)#r0  i  a  Represent a "bound expression".

:class:`.BindParameter` is invoked explicitly using the
:func:`.bindparam` function, as in::

    from sqlalchemy import bindparam

    stmt = select(users_table).where(
        users_table.c.name == bindparam("username")
    )

Detailed discussion of how :class:`.BindParameter` is used is
at :func:`.bindparam`.

.. seealso::

    :func:`.bindparam`

r  r  r  callablers   ru   r\   _traverse_internalsr   r  Optional[_T]FTNc                J   U[         R                  L a  U[         R                  L =(       a    US L nU[         R                  L a  S nUb  [        R                  X5      nU(       aE  [        R                  [        U 5      Ub  [        U[        5      (       d  UOSSS9U l        SU l	        O9U(       a  Xl        O+[        R                  [        U 5      S5      U l        SU l	        U R                  U l
        U=(       d    SU l        X@l        X l        Xpl        Xl        XPl        Xl        S U l        Xl        U(       a  SU l        Uc]  U(       a  U(       a  US   nO[*        R,                  nOUnUb  UR/                  X5      U l        g [*        R2                  " U5      U l        g [        U[0        5      (       a  U" 5       U l        g [5        U5      (       aI  U(       a0  U(       a  US   nOUnUR7                  U5      [9        SU 5      l        g U[9        SU 5      l        g X0l        g )NparamTsanitize_keyr   z%BindParameter[typing_Tuple[Any, ...]])r)   r.   quoted_name	constructr_  r~  rn  r   r  _key_is_anon_identifying_key	_orig_keyr+  rs   r  
isoutparamr)  r.  	expand_opru   _is_crudr   _NO_VALUE_IN_LISTcoerce_compared_valuer  _resolve_value_to_typer#   _resolve_values_to_typesr	   )r   r  rs   rt   r+  r)  quote	callable_r.  r  ru   r,  r-  r  check_values                  rv   __init__BindParameter.__init__  s     v}}$-C)t2CHFMM!E''3C'664 &s,<==  !! 7 	DH !%DH'66r$xIDH $D
 !% 
!$ 
 #
 . DM="'(K"*"<"<K# ,-CC)	 %;;KH	t$$DI5!!"'(K"'K22;? <dCH
  <dCH Iry   c                    U R                  US9nXl        SUl        U[        La  UOU R                  Ul        UR
                  [        R                  L a  [        R                  " U5      Ul        U$ )zHReturn a copy of this :class:`.BindParameter` with the given value
set.
)r.  N)	r&   rs   r  r.   r)  r  r   r  r  )r   rs   r.  r)  cloneds        rv   _with_valueBindParameter._with_value  s]     ,7&.f&<($--;;(+++"99%@FKry   c                \    U R                   (       a  U R                  5       $ U R                  $ )zReturn the value of this bound parameter,
taking into account if the ``callable`` parameter
was set.

The ``callable`` value will be evaluated
and returned if present, else ``value``.

)r  rs   r   s    rv   effective_valueBindParameter.effective_value  s!     ====?"::ry   c                >    [         R                  U 5      nSUl        U$ )a  Produce a copy of this bound parameter that will enable the
:paramref:`_sql.BindParameter.literal_execute` flag.

The :paramref:`_sql.BindParameter.literal_execute` flag will
have the effect of the parameter rendered in the compiled SQL
string using ``[POSTCOMPILE]`` form, which is a special form that
is converted to be a rendering of the literal value of the parameter
at SQL execution time.    The rationale is to support caching
of SQL statement strings that can embed per-statement literal values,
such as LIMIT and OFFSET parameters, in the final SQL string that
is passed to the DBAPI.   Dialects in particular may want to use
this method within custom compilation schemes.

.. versionadded:: 1.4.5

.. seealso::

    :ref:`engine_thirdparty_caching`

T)r   r&   ru   rK  s     rv   render_literal_execute$BindParameter.render_literal_execute.  s!    *   & ry   c                T    U R                   UL a  U R                  5       nXl         U$ U $ rp   )r  r&   )r   r   r   r   s       rv   r   BindParameter._negate_in_binaryG  s(    >>[(;;=D'NKKry   c                <    [         R                  U 5      nXl        U$ rp   )r   r&   r  )r   rt   r   s      rv   r   'BindParameter._with_binary_element_typeO  s      &ry   c                   [         R                  " U 40 UD6nUR                  R                  U R                  5        U(       dG  U R                  (       a6  [
        R                  [        U5      UR                  =(       d    SSS9Ul	        U$ )Nr  Tr  )
r   r&   r   r2  r+  r_  r~  rn  r  r  )r   r.  r   r   s       rv   r&   BindParameter._cloneT  sl      ,, 	
T--.$331q{{-gD 4 AE ry   c                   U R                   R                  R                  SS5      nU(       d  Ub	  SU[        '   g UR                  " U 5      u  pEU(       a  X@R                   4$ Ub  UR                  U 5        UU R                   U R                  R                  U R                  (       a  U R                  U-  U R                  4$ U R                  U R                  4$ )Ninherit_cacheFT)r   r   rJ  r1   get_anonr  r  _static_cache_keyr  r  ru   )r   r]   r  _gen_cache_okid_founds         rv   _gen_cache_keyBindParameter._gen_cache_keye  s    //33OUK#%)"&&t,
((!d# NNII''#'#4#4DHHx  
 	
 ;?((  
 	
ry   c                    U R                   (       d>  SU l         [        R                  [        U 5      U R                  =(       d    SSS9U l        g g )NTr  r  )r+  r_  r~  rn  r  r  r   s    rv   r*   BindParameter._convert_to_unique|  s@    {{DK'664$..3G$ 7 DH ry   c                    U R                   R                  5       nU R                  nU R                  (       a  U R                  5       nSUS'   X!S'   U$ )z4execute a deferred value for serialization purposes.Nr  rs   )r   r   rs   r  )r   r  r   s      rv   r  BindParameter.__getstate__  sF     MM JJ==A AjM'
ry   c                    UR                  SS5      (       a1  [        R                  [        U 5      UR                  SS5      SS9US'   U R                  R                  U5        g )Nr+  Fr  r  Tr  r  )rJ  r_  r~  rn  r   r2  r  s     rv   r   BindParameter.__setstate__  sV    99Xu%%+::4%))K9 ; E%L 	U#ry   c                    U R                   R                  < SU R                  < SU R                  < SU R                  < S3$ )N(z, z, type_=))r   r   r  rs   r  r   s    rv   rm  BindParameter.__repr__  s.    NN##HHJJII	
 	
ry   )r  r  r  r  r  r  r.  r  r  ru   r)  r  r+  rs   )r  rs  rs   r   rt   !Optional[_TypeEngineArgument[_T]]r+  rI  r)  z#Union[bool, Literal[_NoArg.NO_ARG]]r  Optional[bool]r  zOptional[Callable[[], Any]]r.  rI  r  rI  ru   rI  r,  ry  r-  zOptional[TypeEngine[Any]]r  rI  )r   r  )r   r  r  )r.  rI  r   r   r   rB   )"r   r   r   r   r   r   r7   dp_anon_namedp_typedp_plain_dictdp_plain_obj
dp_booleanr  r}  r  r  r  r  r)   r.   r  r  r  r  r  r   r   r&   r  r*  r  r   rm  r   rq   ry   rv   r0  r0    s   ( !N 
!../	"**+	&445	#001	-8893/  
H
HL M
 ]]378> $15  %8<7;ee e 1	e
 e 6e e /e e e e  6e 5e eN /4f 
  2
"
.	$
ry   r0  c                  Z    \ rS rSr% SrSrS\R                  4/rS\	S'   S\	S'   SS jr
S	rg
)
TypeClausei  zLHandle a type keyword in a SQL statement.

Used by the ``Case`` statement.


typeclauser  r\   r  TypeEngine[Any]c                    Xl         g rp   r  r   s     rv   r  TypeClause.__init__  s    	ry   r  N)rt   r  )r   r   r   r   r   r   r7   r  r  r}  r  r   rq   ry   rv   r  r    s<     "N 
"**+3/  ry   r  c                     \ rS rSr% SrSrS\R                  4S\R                  4/r	S\
S'   SrSr\R                  " S	\R                  5      rS
rS
rS
rS
r\SS j5       rS r\SS j5       rSrS\
S'   SrS\
S'   S
r\S 5       rSS jr\      SS j5       r\ RB                  " S5            SS j5       r"\S S j5       r#\S 5       r$ S!   S"S jjr%Sr&g)#
TextClausei  aW  Represent a literal SQL text fragment.

E.g.::

    from sqlalchemy import text

    t = text("SELECT * FROM users")
    result = connection.execute(t)

The :class:`_expression.TextClause` construct is produced using the
:func:`_expression.text`
function; see that function for full documentation.

.. seealso::

    :func:`_expression.text`


textclause_bindparamsr   r\   r  Tz(?<![:\w\x5c]):(\w+)(?!:)Fc                    gNrq   rq   r   s    rv   _hide_fromsTextClause._hide_froms  s    ry   c                    [        X5      $ rp   )r  r  s     rv   r  TextClause.__and__  s    D  ry   c                    U 4$ rp   rq   r   s    rv   r9  TextClause._select_iterable  r;  ry   Nrs  r  r  c                     U R                   S:H  $ N*)r   r   s    rv   r  TextClause._is_star  s    yyCry   c                `   ^  0 T l         U 4S jnT R                  R                  X!5      T l        g )Nc                   > [        U R                  S5      5      TR                  U R                  S5      '   SU R                  S5      -  $ )Nr   z:%s)r0  groupr  )mr   s    rv   repl!TextClause.__init__.<locals>.repl 	  s;    +8+DDQWWQZ(1771:%%ry   )r  _bind_params_regexsubr   )r   r   r,  s   `  rv   r  TextClause.__init__  s*    :<	& ++//;	ry   c                   U R                   R                  5       =U l         nU H   n X4R                     nXCUR                  '   M"     UR                  5        H  u  px X7   nUR                  USS9X7'   M     U $ ! [         a)  n[        R
                  " SUR                  -  5      UeSnAff = f! [         a  n[        R
                  " SU-  5      UeSnAff = f)aC  Establish the values and/or types of bound parameters within
this :class:`_expression.TextClause` construct.

Given a text construct such as::

    from sqlalchemy import text

    stmt = text(
        "SELECT id, name FROM user WHERE name=:name AND timestamp=:timestamp"
    )

the :meth:`_expression.TextClause.bindparams`
method can be used to establish
the initial value of ``:name`` and ``:timestamp``,
using simple keyword arguments::

    stmt = stmt.bindparams(
        name="jack", timestamp=datetime.datetime(2012, 10, 8, 15, 12, 5)
    )

Where above, new :class:`.BindParameter` objects
will be generated with the names ``name`` and ``timestamp``, and
values of ``jack`` and ``datetime.datetime(2012, 10, 8, 15, 12, 5)``,
respectively.  The types will be
inferred from the values given, in this case :class:`.String` and
:class:`.DateTime`.

When specific typing behavior is needed, the positional ``*binds``
argument can be used in which to specify :func:`.bindparam` constructs
directly.  These constructs must include at least the ``key``
argument, then an optional value and type::

    from sqlalchemy import bindparam

    stmt = stmt.bindparams(
        bindparam("name", value="jack", type_=String),
        bindparam("timestamp", type_=DateTime),
    )

Above, we specified the type of :class:`.DateTime` for the
``timestamp`` bind, and the type of :class:`.String` for the ``name``
bind.  In the case of ``name`` we also set the default value of
``"jack"``.

Additional bound parameters can be supplied at statement execution
time, e.g.::

    result = connection.execute(
        stmt, timestamp=datetime.datetime(2012, 10, 8, 15, 12, 5)
    )

The :meth:`_expression.TextClause.bindparams`
method can be called repeatedly,
where it will re-use existing :class:`.BindParameter` objects to add
new information.  For example, we can call
:meth:`_expression.TextClause.bindparams`
first with typing information, and a
second time with value information, and it will be combined::

    stmt = text(
        "SELECT id, name FROM user WHERE name=:name "
        "AND timestamp=:timestamp"
    )
    stmt = stmt.bindparams(
        bindparam("name", type_=String), bindparam("timestamp", type_=DateTime)
    )
    stmt = stmt.bindparams(
        name="jack", timestamp=datetime.datetime(2012, 10, 8, 15, 12, 5)
    )

The :meth:`_expression.TextClause.bindparams`
method also supports the concept of
**unique** bound parameters.  These are parameters that are
"uniquified" on name at statement compilation time, so that  multiple
:func:`_expression.text`
constructs may be combined together without the names
conflicting.  To use this feature, specify the
:paramref:`.BindParameter.unique` flag on each :func:`.bindparam`
object::

    stmt1 = text("select id from table where name=:name").bindparams(
        bindparam("name", value="name1", unique=True)
    )
    stmt2 = text("select id from table where name=:name").bindparams(
        bindparam("name", value="name2", unique=True)
    )

    union = union_all(stmt1.columns(column("id")), stmt2.columns(column("id")))

The above statement will render as:

.. sourcecode:: sql

    select id from table where name=:name_1
    UNION ALL select id from table where name=:name_2

.. versionadded:: 1.3.11  Added support for the
   :paramref:`.BindParameter.unique` flag to work with
   :func:`_expression.text`
   constructs.

z?This text() construct doesn't define a bound parameter named %rNF)r)  )r  r   r  KeyErrorr;   ArgumentErrorr   r  )	r   bindsnames_to_values
new_paramsr   existingr  r  rs   s	            rv   r  TextClause.bindparams	  s   X )-(8(8(=(=(??:D6 &nn5 268--.  *//1JCN%? #+"6"6uu"6"M
 2 %  ''/15@   ''/145 s/   A:B0:
B-$B((B-0
C:CCzsqlalchemy.sql.selectablec           	     ^   [         R                  R                  nU Vs/ s H(  n[        R                  " [
        R                  U5      PM*     nnU Vs/ s HD  nUR                  U;   a/  [        UR                  UR                  UR                  5      5      OUPMF     nnUR                  5        VVs/ s H  u  px[        Xx5      PM     n	nnUR                  R                  UR                  5      n
U
R                  U Xi-   [        U5      =(       a    U	(       + S9  U
$ s  snf s  snf s  snnf )a  Turn this :class:`_expression.TextClause` object into a
:class:`_expression.TextualSelect`
object that serves the same role as a SELECT
statement.

The :class:`_expression.TextualSelect` is part of the
:class:`_expression.SelectBase`
hierarchy and can be embedded into another statement by using the
:meth:`_expression.TextualSelect.subquery` method to produce a
:class:`.Subquery`
object, which can then be SELECTed from.

This function essentially bridges the gap between an entirely
textual SELECT statement and the SQL expression language concept
of a "selectable"::

    from sqlalchemy.sql import column, text

    stmt = text("SELECT id, name FROM some_table")
    stmt = stmt.columns(column("id"), column("name")).subquery("st")

    stmt = (
        select(mytable)
        .select_from(mytable.join(stmt, mytable.c.name == stmt.c.name))
        .where(stmt.c.id > 5)
    )

Above, we pass a series of :func:`_expression.column` elements to the
:meth:`_expression.TextClause.columns` method positionally.  These
:func:`_expression.column`
elements now become first class elements upon the
:attr:`_expression.TextualSelect.selected_columns` column collection,
which then
become part of the :attr:`.Subquery.c` collection after
:meth:`_expression.TextualSelect.subquery` is invoked.

The column expressions we pass to
:meth:`_expression.TextClause.columns` may
also be typed; when we do so, these :class:`.TypeEngine` objects become
the effective return type of the column, so that SQLAlchemy's
result-set-processing systems may be used on the return values.
This is often needed for types such as date or boolean types, as well
as for unicode processing on some dialect configurations::

    stmt = text("SELECT id, name, timestamp FROM some_table")
    stmt = stmt.columns(
        column("id", Integer),
        column("name", Unicode),
        column("timestamp", DateTime),
    )

    for id, name, timestamp in connection.execute(stmt):
        print(id, name, timestamp)

As a shortcut to the above syntax, keyword arguments referring to
types alone may be used, if only type conversion is needed::

    stmt = text("SELECT id, name, timestamp FROM some_table")
    stmt = stmt.columns(id=Integer, name=Unicode, timestamp=DateTime)

    for id, name, timestamp in connection.execute(stmt):
        print(id, name, timestamp)

The positional form of :meth:`_expression.TextClause.columns`
also provides the
unique feature of **positional column targeting**, which is
particularly useful when using the ORM with complex textual queries. If
we specify the columns from our model to
:meth:`_expression.TextClause.columns`,
the result set will match to those columns positionally, meaning the
name or origin of the column in the textual SQL doesn't matter::

    stmt = text(
        "SELECT users.id, addresses.id, users.id, "
        "users.name, addresses.email_address AS email "
        "FROM users JOIN addresses ON users.id=addresses.user_id "
        "WHERE users.id = 1"
    ).columns(
        User.id,
        Address.id,
        Address.user_id,
        User.name,
        Address.email_address,
    )

    query = (
        session.query(User)
        .from_statement(stmt)
        .options(contains_eager(User.addresses))
    )

The :meth:`_expression.TextClause.columns` method provides a direct
route to calling :meth:`_expression.FromClause.subquery` as well as
:meth:`_expression.SelectBase.cte`
against a textual SELECT statement::

    stmt = stmt.columns(id=Integer, name=String).cte("st")

    stmt = select(sometable).where(sometable.c.id == stmt.c.id)

:param \*cols: A series of :class:`_expression.ColumnElement` objects,
 typically
 :class:`_schema.Column` objects from a :class:`_schema.Table`
 or ORM level
 column-mapped attributes, representing a set of columns that this
 textual string will SELECT from.

:param \**types: A mapping of string names to :class:`.TypeEngine`
 type objects indicating the datatypes to use for names that are
 SELECTed from the textual string.  Prefer to use the ``*cols``
 argument as it also indicates positional ordering.

)
positional)r=   r   sql_selectabler   r}   r   LabeledColumnExprRoler  r   r  r   rX   r   _initrI  )r   colstypesrl  col
input_colspositional_input_colsr  rt   keyed_input_colselems              rv   rk  TextClause.columns	  s&   n ^^22
 KO.
JN3IU88#>$ 	 .
 "!
 " 77e# SWWeii&89 " 	 !
 8={{}4
7DL$} 	 4
 ''//
0H0HI

!412K;K7K 	 	

 -.
!
4
s   /DAD$4D)c                "    [         R                  $ rp   r  r   s    rv   r  TextClause.type!
  s       ry   c                8    U R                   R                  U 5      $ rp   )r  r  r   s    rv   r  TextClause.comparator%
  s     yy++D11ry   c                B    U[         R                  L a  [        U 5      $ U $ rp   )r   in_opr  r;  s     rv   r=  TextClause.self_group+
  s     ioo%D>!Kry   )r  r   )r   zIterable[FromClause]r  )r   r   )r4  r0  r5  r   r   rB   )r>  _ColumnExpressionArgument[Any]r?  z_TypeEngineArgument[Any]r   rX   )r   r  rp   r<  ry  r   zUnion[Self, Grouping[Any]])'r   r   r   r   r   r   r7   dp_string_clauseelement_dict	dp_stringr  r}  r  r  rer   UNICODEr.  r  r  r  r  r  r  r  r9  r  r  r  r  r  r(   r  r=   r   rk  r  r  r=  r   rq   ry   rv   r  r    s   & "N 
)FFG	",,-3/ 
 OK$@"**M"&+#!$ !  
 C FM     	< E"E E 
	E EN 
45N-N *N 
	N 6N` ! ! 2 2 15-	# ry   r  c                      \ rS rSr% SrSr/ rS\S'   S \S'   \(       d  \	R                  SS j5       r\SS j5       rS	rg
)Nulli4
  zzRepresent the NULL keyword in a SQL statement.

:class:`.Null` is accessed as a constant via the
:func:`.null` function.

nullr\   r  
_singletonc                "    [         R                  $ rp   r  r   s    rv   r  	Null.typeC
  s    $$$ry   c                "    [         R                  $ )z+Return a constant :class:`.Null` construct.)rT  rV  clss    rv   	_instanceNull._instanceG
  s     ry   rq   Nr  )r   rT  )r   r   r   r   r   r   r  r}  r   r=   rz  r  classmethodr\  r   rq   ry   rv   rT  rT  4
  sO     N24/4				% 
 	%  ry   rT  c                      \ rS rSr% SrSr/ rS\S'   S \S'   \(       d  \	R                  SS j5       rSS jr\SS	 j5       rS
rg)False_iQ
  zRepresent the ``false`` keyword, or equivalent, in a SQL statement.

:class:`.False_` is accessed as a constant via the
:func:`.false` function.

falser\   r  rV  c                "    [         R                  $ rp   r   r  r   s    rv   r  False_.typea
      '''ry   c                "    [         R                  $ rp   True_rV  r   s    rv   rY  False_._negatee
  s    ry   c                "    [         R                  $ rp   r`  rV  rZ  s    rv   r\  False_._instanceh
  s       ry   rq   Nr  r   rh  r   r`  )r   r   r   r   r   r   r  r}  r   r=   rz  r  rY  r^  r\  r   rq   ry   rv   r`  r`  Q
  sT     N24/4				( 
 	(  ! !ry   r`  c                      \ rS rSr% SrSr/ rS\S'   S \S'   \(       d  \	R                  SS j5       rSS jr\    SS	 j5       r\SS
 j5       rSrg)rh  ip
  zRepresent the ``true`` keyword, or equivalent, in a SQL statement.

:class:`.True_` is accessed as a constant via the
:func:`.true` function.

truer\   r  rV  c                "    [         R                  $ rp   rc  r   s    rv   r  
True_.type
  re  ry   c                "    [         R                  $ rp   rk  r   s    rv   rY  True_._negate
  s       ry   c                ,    Uc  U R                  5       $ U$ rp   )r\  )r[  r8  s     rv   _ifnoneTrue_._ifnone
  s     ===?"Lry   c                "    [         R                  $ rp   rg  rZ  s    rv   r\  True_._instance
  s    ry   rq   Nr  rn  )r8  Optional[ColumnElement[Any]]r   r  rm  )r   r   r   r   r   r   r  r}  r   r=   rz  r  rY  r^  rv  r\  r   rq   ry   rv   rh  rh  p
  sx     N24/4				( 
 	(! 0	     ry   rh  c                  P   \ rS rSr% SrSrSrS\R                  4S\R                  4/r
S\S'   S	\S'   \R                  SS\R                  S
.         SS jjr\ S     SS jj5       rSS jrSS jr\SS j5       rS r\R2                  SS j5       r S   SS jjrSrg)
ClauseListi
  zrDescribe a list of clauses, separated by an operator.

By default, is comma-separated, such as a column listing.


clauselistTclausesr^  r\   r  r  )r^  r*  group_contents_literal_as_text_rolec          	        Xl         X l        X0l        UnUnXpl        U R                  (       aC  U Vs/ s H/  n[        R
                  " XxU S9R                  U R                   S9PM1     snU l        O+U Vs/ s H  n[        R
                  " XxU S9PM     snU l        [        R                  " U R                   5      U l
        g s  snf s  snf )Napply_propagate_attrsr]  )r^  r*  r  _text_converter_roler   r}   r=  r~  r   
is_booleanr  )	r   r^  r*  r  r  r~  clauses_iteratortext_converter_roler   s	            rv   r  ClauseList.__init__
  s     !
,EL3H$7!
 /	 /F   't*T]]*34 /	DL /	 /F   't /	DL '0&:&:4==&I#s   6C5CNc                    U R                  U 5      nU(       a  [        U5      O/ Ul        SUl        Xl        SUl        SUl        U$ )NTF)r   rQ  r~  r*  r^  r  r  r[  r^  r~  r   s       rv   _construct_rawClauseList._construct_raw
  sB     {{3(/tG}R
 "&+#ry   c                ,    [        U R                  5      $ rp   iterr~  r   s    rv   __iter__ClauseList.__iter__
      DLL!!ry   c                ,    [        U R                  5      $ rp   lenr~  r   s    rv   __len__ClauseList.__len__
      4<<  ry   c                    [         R                  R                  U R                   Vs/ s H  oR                  PM     sn5      $ s  snf rp   )rI  rJ  from_iterabler~  r9  )r   rD  s     rv   r9  ClauseList._select_iterable
  s6    ,,/3||<|t""|<
 	
<s   Ac                >   U R                   (       aR  U R                  R                  [        R                  " U R
                  U5      R                  U R                  S95        g U R                  R                  [        R                  " U R
                  U5      5        g Nr]  )r  r~  r  r   r}   r  r=  r^  r   r   s     rv   r  ClauseList.append
  su    LL  !:!:FCNN MM O  LL  !:!:FCry   c                    [        [        R                  " U R                   Vs/ s H  oR                  PM     sn6 5      $ s  snf rp   rQ  rI  rJ  r~  r   rK  s     rv   r   ClauseList._from_objects
  .    IOOt||%L|!oo|%LMNN%L   Ac                    U R                   (       a1  [        R                  " U R                  U5      (       a  [	        U 5      $ U $ rp   )r*  r   is_precedentr^  r  r;  s     rv   r=  ClauseList.self_group
  s0     ::)00HHD>!Kry   )r  r  r~  r*  r  r^  )
r~  rM  r^  rP   r*  rI  r  rI  r  zType[roles.SQLRole]rp   )r^  rP   r~  r  r   r|  r   zIterator[ColumnElement[Any]]r  r  ru  rN  )r   r   r   r   r   r   r  r7   dp_clauseelement_listdp_operatorr  r}  r   comma_opr   WhereHavingRoler  r^  r  r  r  r  r9  r  r=   r  r   r=  r   rq   ry   rv   r|  r|  
  s5    "N O 
%;;<	&2233/ 
 &%
 "+!3!3#5:5J5JJ0J J 	J
 J  3J>  ;? 8 
	 "! 
 


 
""O #O 15-	# ry   r|  c                      \ rS rSr% SrS\S'   S\S'   SrS\S	'   \S
 5       r S   SS jjr	\  SS j5       r
\SSS.             SS jj5       rSrg)OperatorExpressioni  zSbase for expressions that contain an operator and operands

.. versionadded:: 2.0

rP   r^  r  r  TrI  r*  c                B    [         R                  " U R                  5      $ rp   )r   r  r^  r   s    rv   r   OperatorExpression.is_comparison  s    &&t}}55ry   Nc                    U R                   (       a&  [        R                  " U R                  U5      (       d8  U[        R                  L a0  [        R
                  " U R                  5      (       d  [        U 5      $ U $ rp   )r*  r   r  r^  r`  r  r  r;  s     rv   r=  OperatorExpression.self_group  sV     JJ&&t}}g>>
 9==(!,,T]];; D>!Kry   c                    [        5       erp   r  r   s    rv   _flattened_operator_clauses.OperatorExpression._flattened_operator_clauses%  s     "##ry   )negate	modifiersc          	        [         R                  " U5      (       a  Ub
   SU 35       eSn[        USS 5      UL a/  UR                  UR                  5      (       a  SnUR
                  nOU4n[        USS 5      UL a/  UR                  UR                  5      (       a  SnUR
                  n	OU4n	U(       a  [        R                  " UU/X-   Q76 $ UR                  (       a  S n[        XX4XVS9$ )Nz.negate not supported for associative operator Fr^  T)rt   r  r  )
r   is_associativer  _compare_type_affinityr  r  ExpressionClauseList_construct_for_listr  BinaryExpression)
r[  leftrightr  rt   r  r  multileft_flattenedright_flatteneds
             rv   _construct_for_op$OperatorExpression._construct_for_op+  s    ##B''E?tDE Ej$44TYY??!%!A!A"&z444UZZ@@"'"C"C#((+?? %6  ))F
 	
ry   rq   rp   r<  ry  r   zUnion[Self, Grouping[_T]]r   %typing_Tuple[ColumnElement[Any], ...])r  r  r  r  r  rP   rt   r  r  ry  r  rx  r   zOperatorExpression[_T])r   r   r   r   r   r}  r*  r  r  r=  r  r^  r  r   rq   ry   rv   r  r    s     
E46 6 15-	"$ $	.$ $
  *.15,
 ,
 ",
 	,
 ,
 ',
 /,
 
 ,
 ,
ry   r  c                  :   \ rS rSr% SrSrS\R                  4S\R                  4/r	S\
S'   S\
S'   S	\
S
'   SS.     SS jjr\  SS j5       rSS jrSS jr\SS j5       r\R$                  SS j5       rSS jr\SS.         S S jj5       rS!S jrSrg)"r  i[  a!  Describe a list of clauses, separated by an operator,
in a column expression context.

:class:`.ExpressionClauseList` differs from :class:`.ClauseList` in that
it represents a column-oriented DQL expression only, not an open ended
list of anything comma separated.

.. versionadded:: 2.0

expression_clauselistr~  r^  r\   r  r  rI  r*  Nrt   c                  ^  UT l         [        U 4S jU 5       5      T l        [        R                  " T R                   5      T l        [        R                  " U5      T l        g )Nc              3  l   >#    U  H)  n[         R                  " [        R                  UTS 9v   M+     g7f)r  N)r   r}   r   ExpressionElementRole)r?  r   r   s     rv   r@  0ExpressionClauseList.__init__.<locals>.<genexpr>z  s4      
 " ++V4 "s   14)	r^  rH  r~  r   r  r  r   to_instancer  )r   r^  rt   r~  s   `   rv   r  ExpressionClauseList.__init__r  sR     ! 
 "	
 
 '0&:&:4==&I#((/	ry   c                    U R                   $ rp   r~  r   s    rv   r  0ExpressionClauseList._flattened_operator_clauses  s     ||ry   c                ,    [        U R                  5      $ rp   r  r   s    rv   r  ExpressionClauseList.__iter__  r  ry   c                ,    [        U R                  5      $ rp   r  r   s    rv   r  ExpressionClauseList.__len__  r  ry   c                    U 4$ rp   rq   r   s    rv   r9  %ExpressionClauseList._select_iterable  r;  ry   c                    [        [        R                  " U R                   Vs/ s H  oR                  PM     sn6 5      $ s  snf rp   r  rK  s     rv   r   "ExpressionClauseList._from_objects  r  r  c                0    U =R                   U4-  sl         g rp   r  r  s     rv   _append_inplace$ExpressionClauseList._append_inplace  s    	!ry   T)r*  c                  ^ U R                  U 5      nX5l        U(       a  [        U4S jU 5       5      Ul        OXEl        TUl        X%l        U H(  nUR                  (       d  M  UR                  Ul          U$    U$ )Nc              3  @   >#    U  H  oR                  TS 9v   M     g7f)r]  N)r=  )r?  r   r^  s     rv   r@  ;ExpressionClauseList._construct_for_list.<locals>.<genexpr>  s      !8?1X.s   )r   r*  rH  r~  r^  r  r   )r[  r^  rt   r*  r~  r   r   s    `     rv   r  (ExpressionClauseList._construct_for_list  sz     {{3
  !8?! DL #L 	A!!!()(:(:%	  ry   c                    U R                  [        R                  S9n[        U[        5      (       d   e[        U[        R                  SS9$ r  r_  rc  s     rv   rY  ExpressionClauseList._negate  sA    //)--/8'=1111immT
 	
ry   )r  r   r~  r*  r^  r  )r^  rP   r~  rM  rt   r
  r  r  r  r  ru  )r   r  r   r1  )
r^  rP   rt   r  r~  r  r*  rI  r   zExpressionClauseList[_T]r   r   )r   r   r   r   r   r   r7   dp_clauseelement_tupler  r  r}  r  r  r  r  r  r9  r=   r  r   r  r^  r  rY  r   rq   ry   rv   r  r  [  s   	 -N 
%<<=	&2233/ 
 32K 48	00 10 1	0" 	. 
"!   
""O #O"    %	
  
" .
ry   r  c                  z  ^  \ rS rSrSrSrS r\          SS j5       r\\	R                  4             SS jj5       r\    SS j5       r\ S     SS jj5       r\\	R                  4     SS	 jj5       r\\	R                  4     SS
 jj5       r\SS j5       r S   SU 4S jjjrSrU =r$ )r  i  r  Tc                    [        S5      e)Nz+BooleanClauseList has a private constructorr  )r   argr   s      rv   r  BooleanClauseList.__init__  s    !9
 	
ry   c                   S n/ n[         R                  nSnU H5  n	XL a  U	nM  XL a  U	/nSn  O#U(       d  SnOUnSnUR                  U	5        M7     U(       d  Ub  U/nSnX V
s/ s H  oR                  US9PM     sn
4$ s  sn
f )Nr   r   r:   r]  )r   r  r  r=  )r[  r^  continue_onskip_onr~  has_continue_onconvert_clausesr<  lccr   r   s              rv   _process_clauses_for_boolean.BooleanClauseList._process_clauses_for_boolean  s     ##F$ #)" $*(C&G C&&v.) , ?#>./OCOLOq\\'\2OLLLLs   %Bc                t  ^ U[         R                  L ao  TR                  n[        R                  " SU SU SU SU[
        R                  L a  SOS SU SU[
        R                  L a  SOS	 S
3SS9  U R                  T5      $ U R                  TUU[        R                  " U4U-   5       Vs/ s H(  n[        R                  " [        R                  U5      PM*     sn5      u  pU	S:  a;  [        R                  R!                  U4S jU
 5       5      nU R                  TU5      $ U	(       d   eU
S   $ s  snf )Nz	Invoking z_() without arguments is deprecated, and will be disallowed in a future release.   For an empty z() construct, use 'r  ztrue()zfalse()z, *args)' or 'TrueFalsez
, *args)'.r  )versionr   c              3  p   >#    U  H+  n[        US S5      TL a  S UR                   5       OU4v   M-     g7f)r^  Nc              3  $   #    U  H  ov   M     g 7frp   rq   r>  s     rv   r@  9BooleanClauseList._construct.<locals>.<genexpr>.<genexpr>  s     D C1Q Cs   )r  r  )r?  to_flatr^  s     rv   r@  /BooleanClauseList._construct.<locals>.<genexpr>  sE      >  /G w
D9XE E C CD!$  /s   36r   )r)   r.   r   r=   warn_deprecatedrh  rV  r  r  coerce_generator_argr   r}   r   r  rI  rJ  r  )r[  r^  r  r  initial_clauser~  r   r  r   r  r  flattened_clausess    `          rv   
_constructBooleanClauseList._construct  se    V]]* $$D  D6 "JF-dV1 +u/?/? ?HY5a)U-=-==F7  
 %%h//"?? #77#%/F   !6!6?	
 
 7 !* = = >  /> ! %%h0ABBJ3 #1%%5s   ./D5c                    [         R                  [        R                  [        R                  pCnU R                  UUUU5      u  pVUS:  a  U R                  X&5      $ US:X  a  US   $ g )Nr   r   )r   r  rh  rV  r`  r  r  )r[  r~  r^  r  r  r  r  s          rv   _construct_for_whereclause,BooleanClauseList._construct_for_whereclause+  sx    
 NN  '  #??	 
 7 %%h@@AX #1%%ry   c                    U R                  U 5      nU(       a  [        U5      OSUl        SUl        Xl        [
        R                  Ul        SUl        U$ )Nrq   T)	r   rH  r~  r*  r^  r   r  r  r  r  s       rv   r   BooleanClauseList._construct_rawG  sG     {{3)0uW~b
 ((	&*#ry   c                    U R                   " [        R                  [        R                  [
        R                  U/UQ76 $ )zgProduce a conjunction of expressions joined by ``AND``.

See :func:`_sql.and_` for full documentation.
)r   r   r  rh  rV  r`  r[  r  r~  s      rv   r  BooleanClauseList.and_U  s;     ~~NN	

 
 	
ry   c                    U R                   " [        R                  [        R                  [
        R                  U/UQ76 $ )zeProduce a conjunction of expressions joined by ``OR``.

See :func:`_sql.or_` for full documentation.
)r   r   r  r`  rV  rh  r  s      rv   r  BooleanClauseList.or_i  s;     ~~MM	

 
 	
ry   c                    U 4$ rp   rq   r   s    rv   r9  "BooleanClauseList._select_iterable}  r;  ry   c                D   > U R                   (       d  U $ [        TU ]	  US9$ r  )r~  r  r=  )r   r<  r   s     rv   r=  BooleanClauseList.self_group  s$     ||K7%g%66ry   )r  r~  r*  r^  r  )
r^  rP   r  r   r  r   r~  Iterable[ColumnElement[Any]]r   z+typing_Tuple[int, List[ColumnElement[Any]]])r^  rP   r  r   r  r   r  r   r~  r   r   r   r   r  )r~  r  r   Optional[ColumnElement[bool]]rp   )r^  rP   r~  r  r   r  )r  z=Union[Literal[True], _ColumnExpressionArgument[bool], _NoArg]r~  _ColumnExpressionArgument[bool]r   r   )r  z>Union[Literal[False], _ColumnExpressionArgument[bool], _NoArg]r~  r  r   r   r  )r<  ry  r   zUnion[Self, Grouping[bool]])r   r   r   r   r   r  r  r^  r  r)   r.   r   r  r  r  r  r  r9  r=  r   r  r   s   @rv   r  r    s   ,NM

 (M(M (M 	(M
 .(M 
5(M (MT  %mm:&:& :& 	:&
 :& :& :& 
:& :&x 2	& 6  ;? 8 
	  
 MM	



 2
 

 
& 
 MM	



 2
 

 
&   157-7	$7 7ry   r  c                     ^  \ rS rSr% SrSr\R                  / -   rS\S'   S\S'   \	R                  " S5      S	S
.   SU 4S jjj5       r\SS j5       rSS jrSSS jjrSrU =r$ )r   i  zRepresent a SQL tuple.rH  r\   r  rY   r  sqlalchemy.sql.sqltypesN)r?  c          
     b  > [         R                  R                  nUc6  U Vs/ s H(  n[        R                  " [
        R                  U5      PM*     nnO[        U5      [        U5      :w  a$  [        R                  " S[        U5      U4-  5      e[        X5       VVs/ s H<  u  pd[        R                  " [
        R                  UUR                  (       d  UOS S9PM>     nnnUR                  " U Vs/ s H  owR                  PM     sn6 U l        [        TU ]<  " U6   g s  snf s  snnf s  snf )Nz*Wrong number of elements for %d-tuple: %r r  )r=   r   sql_sqltypesr   r}   r   r  r  r;   r3  zip_isnullrY   r  r  r  )	r   r?  r~  sqltypesr   init_clausestypr  r   s	           rv   r  Tuple.__init__  s    >>..= !6 A   !<!<a@   6L
 5zS\)''@5z7+,  "%1 2FC   //%([[#d
 2   &&\(J\c\(JK	,')6 )Ks   /D!AD&5D,c                    U 4$ rp   rq   r   s    rv   r9  Tuple._select_iterable  r;  ry   c                    U(       a  [        S UUSSUU R                  S9$ [        [        X R                  R                  5       VVs/ s H  u  pV[        S UUUSUS9PM     snn6 $ s  snnf )NT)rs   r,  r+  r.  rt   r-  )r,  r-  r+  rt   )r0  r  r   r  r?  )r   r^  r2  rt   r.  ocompared_to_types          rv   r3  Tuple._bind_param  s     &."&))   033		/H
 0I+ ".6*:## 0I
 
s   A'
c                    U $ rp   rq   r;  s     rv   r=  Tuple.self_group      ry   r  )r~  rM  r?  z,Optional[Sequence[_TypeEngineArgument[Any]]]r  r(  rp   r<  ry  r   rB   )r   r   r   r   r   r   r|  r  r}  r=   r   r  r  r9  r3  r=  r   r  r   s   @rv   r   r     s     N 	&&+ /  O	23 ?C(0( <( 4(<  4 ry   r   .c                      \ rS rSr% SrSrS\R                  4S\R                  4S\R                  4/r	S\
S'   S	\
S'   S
\
S'   S\
S'   SSS.     SS jjr\R                  SS j5       rSrg)Casei  a  Represent a ``CASE`` expression.

:class:`.Case` is produced using the :func:`.case` factory function,
as in::

    from sqlalchemy import case

    stmt = select(users_table).where(
        case(
            (users_table.c.name == "wendy", "W"),
            (users_table.c.name == "jack", "J"),
            else_="E",
        )
    )

Details on :class:`.Case` usage is at :func:`.case`.

.. seealso::

    :func:`.case`

casers   whenselse_r\   r  z:List[typing_Tuple[ColumnElement[bool], ColumnElement[_T]]]r  rz  N)rs   r+  c          
        [         R                  " SSU5      n [        R                  " U5      nU VVs/ s H\  u  pV[         R
                  " [        R                  UU S9R                  5       [         R
                  " [        R                  U5      4PM^     snnU l	        Uc  S U l
        O*[         R
                  " [        R                  U5      U l
        Ub+  [         R
                  " [        R                  U5      U l        OS U l        [        S [        U R                  5       5       U R                  b  U R                  R                  O[        R                   5      n[#        [$        U5      U l        g ! [         a     GNUf = fs  snnf )Nr*  r)  r  c              3  x   #    U  H0  Gt pUR                   R                  (       a  M"  UR                   v   M2     g 7frp   )r  r  )r?  ry  thens      rv   r@   Case.__init__.<locals>.<genexpr>*  s0       !5HQyy((	 		 !5s   !::)r   !_expression_collection_was_a_listr=   dictlike_iteritemsrh  r}   r   r  r=  r*  rs   r+  nextreversedr  r   r  r	   rf   )r   rs   r+  r*  	new_whensr   rrt   s           rv   r  Case.__init__  sL    $-#N#NVU$
		//	:I $

 $   //*. *,  !<!<a@ $


 =DJ"))%*E*EuMDJ"))%*E*EuMDJDJ !) 4	  $zz5DJJOO8;L;L	
 UO	G  		

s   E8 A#F	8
FFc                    [        [        R                  " U R                  5        Vs/ s H  oR                  PM     sn6 5      $ s  snf rp   )rQ  rI  rJ  r   r   )r   xs     rv   r   Case._from_objects5  s:    OOt7H7H7JK7J!oo7JKL
 	
Ks   A)r+  r  rs   r*  )r*  zLUnion[typing_Tuple[_ColumnExpressionArgument[bool], Any], Mapping[Any, Any]]rs   Optional[Any]r+  r:  ru  )r   r   r   r   r   r   r7   dp_clauseelementdp_clauseelement_tuplesr  r}  r  r=   r  r   r   rq   ry   rv   r(  r(    s    . N 
#445	#;;<	#4453/  FE&&''  $#1$
1$ 1$ 1$f 
""
 #
ry   r(  c                      \ rS rSr% SrSrS\R                  4S\R                  4/r	S\
S'   S\
S'   S	\
S'   S
\
S'       SS jr\R                  SS j5       r\S 5       rSrg)rq  i<  a  Represent a ``CAST`` expression.

:class:`.Cast` is produced using the :func:`.cast` factory function,
as in::

    from sqlalchemy import cast, Numeric

    stmt = select(cast(product_table.c.unit_price, Numeric(10, 4)))

Details on :class:`.Cast` usage is at :func:`.cast`.

.. seealso::

    :ref:`tutorial_casts`

    :func:`.cast`

    :func:`.try_cast`

    :func:`.type_coerce` - an alternative to CAST that coerces the type
    on the Python side only, which is often sufficient to generate the
    correct SQL and data coercion.

r	   r   r  r\   r  r  r  r  r  c                    [         R                  " U5      U l        [        R                  " [
        R                  UU R                  U S9U l        [        U R                  5      U l	        g N)rt   r  )
r   r  r  r   r}   r   r  r   r  r  r   r6  rt   s      rv   r  Cast.__init__a  sP    
 ((/	&&''))"&	
 %TYY/ry   c                .    U R                   R                  $ rp   r   r   r   s    rv   r   Cast._from_objectso      {{(((ry   c                    U R                   $ rp   r   r   s    rv   r  Cast.wrapped_column_expressions      {{ry   )r   r  r  Nr6  rM  rt   _TypeEngineArgument[_T]ru  )r   r   r   r   r   r   r7   r;  r  r  r}  r  r=   r  r   r  r  r   rq   ry   rv   rq  rq  <  s    2 N 
$556	"**+3/ 
 
020 '0 
"") #)  ry   rq  c                       \ rS rSrSrSrSrSrg)TryCastix  zRepresent a TRY_CAST expression.

Details on :class:`.TryCast` usage is at :func:`.try_cast`.

.. seealso::

    :func:`.try_cast`

    :ref:`tutorial_casts`
try_castTrq   N)r   r   r   r   r   r   r  r   rq   ry   rv   rM  rM  x  s    	  NMry   rM  c                      \ rS rSr% SrSrS\R                  4S\R                  4/r	S\
S'   S\
S'   S	\
S'       SS
 jr\R                  SS j5       r\R                   S 5       r\S 5       r S   SS jjrSrg)
TypeCoercei  zRepresent a Python-side type-coercion wrapper.

:class:`.TypeCoerce` supplies the :func:`_expression.type_coerce`
function; see that function for usage details.

.. seealso::

    :func:`_expression.type_coerce`

    :func:`.cast`

type_coercer   r  r\   r  r  r  c                    [         R                  " U5      U l        [        R                  " [
        R                  UU R                  U S9U l        g r?  )r   r  r  r   r}   r   r  r   r@  s      rv   r  TypeCoerce.__init__  s>    
 ((/	&&''))"&	
ry   c                .    U R                   R                  $ rp   rC  r   s    rv   r   TypeCoerce._from_objects  rE  ry   c                    [        U R                  [        5      (       a-  U R                  R                  5       nU R                  Ul        U$ U R                  $ rp   )r   r   r0  r&   r  )r   bps     rv   typed_expressionTypeCoerce.typed_expression  s?    dkk=11##%BiiBGI;;ry   c                    U R                   $ rp   rG  r   s    rv   r  $TypeCoerce.wrapped_column_expression  rI  ry   Nc                ~    U R                   R                  US9nX R                   La  [        X R                  5      $ U $ r  )r   r=  rP  r  )r   r<  rd  s      rv   r=  TypeCoerce.self_group  s9     ++(((9++%gyy11Kry   )r   r  rJ  ru  rp   )r<  ry  r   zTypeCoerce[_T])r   r   r   r   r   r   r7   r;  r  r  r}  r  r=   r  r   r,   r  rX  r  r  r=  r   rq   ry   rv   rP  rP    s     #N 
$556	"**+3/ 
 

2
 '
 
"") #) ## $   15-	 ry   rP  c                      \ rS rSr% SrSrS\R                  4S\R                  4/r	S\
S'   S\
S'   S	\
S'   SS
 jr\R                  SS j5       rSrg)Extracti  z=Represent a SQL EXTRACT clause, ``extract(field FROM expr)``.extractexprfieldr\   r  r  r   c                    [         R                  U l        Xl        [        R
                  " [        R                  U5      U l        g rp   )	r   INTEGERTYPEr  rb  r   r}   r   r  ra  )r   rb  ra  s      rv   r  Extract.__init__  s.    ((	
$$U%@%@$G	ry   c                .    U R                   R                  $ rp   )ra  r   r   s    rv   r   Extract._from_objects  s    yy&&&ry   )ra  rb  r  N)rb  r   ra  rM  ru  )r   r   r   r   r   r   r7   r;  rP  r  r}  r  r=   r  r   r   rq   ry   rv   r_  r_    sg    GN 
"334	#--.3/ 
 JH
 
""' #'ry   r_  c                      \ rS rSr% SrSrS\R                  4/rS\	S'   S\	S'   SS jr
\R                  SS	 j5       rS
rg)_label_referencei  a  Wrap a column expression as it appears in a 'reference' context.

This expression is any that includes an _order_by_label_element,
which is a Label, or a DESC / ASC construct wrapping a Label.

The production of _label_reference() should occur when an expression
is added to this context; this includes the ORDER BY or GROUP BY of a
SELECT statement, as well as a few other places, such as the ORDER BY
within an OVER clause.

label_referenceelementr\   r  r  c                    Xl         g rp   rk  r   rk  s     rv   r  _label_reference.__init__      ry   c                    / $ rp   rq   r   s    rv   r   _label_reference._from_objects  r   ry   rm  N)rk  r  ru  )r   r   r   r   r   r   r7   r;  r  r}  r  r=   r  r   r   rq   ry   rv   ri  ri    sV    
 'N 
%6673/   
"" #ry   ri  c                  t    \ rS rSr% SrS\R                  4/rS\S'   S
S jr	\
R                  SS j5       rSrg	)_textual_label_referencei  textual_label_referencerk  r\   r  c                    Xl         g rp   rm  rn  s     rv   r  !_textual_label_reference.__init__  rp  ry   c                ,    [        U R                  5      $ rp   )r  rk  r   s    rv   _text_clause%_textual_label_reference._text_clause  s    $,,''ry   rm  N)rk  r   )r   r  )r   r   r   r   r   r7   rP  r  r}  r  r=   rz  ry  r   rq   ry   rv   rt  rt    sG    .N 
%//03/  
( (ry   rt  c                     \ rS rSr% SrSrS\R                  4S\R                  4S\R                  4/r	S\
S'   S	\
S'       S         SS jjr\    SS j5       r\    SS j5       r\    SS j5       r\    SS j5       r\    SS j5       r\    SS j5       r\SS j5       r\R,                  SS j5       rS r S   SS jjrSrg
) rb  i  a  Define a 'unary' expression.

A unary expression has a single column expression
and an operator.  The operator can be placed on the left
(where it is called the 'operator') or right (where it is called the
'modifier') of the column expression.

:class:`.UnaryExpression` is the basis for several unary operators
including those used by :func:`.desc`, :func:`.asc`, :func:`.distinct`,
:func:`.nulls_first` and :func:`.nulls_last`.

unaryrk  r^  modifierr\   r  r   Nc                    X l         X0l        UR                  U l        UR                  U R                   =(       d    U R                  S9U l        [
        R                  " U5      U l        XPl        g r  )	r^  r}  r   r=  rk  r   r  r  r  )r   rk  r^  r}  rt   r  s         rv   r  UnaryExpression.__init__#  s]     !  ' 8 8))MM2T]] * 
 ((/	'>$ry   c                z    [        [        R                  " [        R                  U5      [
        R                  SS9$ NF)r}  r  )rb  r   r}   r   ByOfRoler   nulls_first_opr[  columns     rv   _create_nulls_first#UnaryExpression._create_nulls_first8  s1    
 U^^V4--$)
 	
ry   c                z    [        [        R                  " [        R                  U5      [
        R                  SS9$ r  )rb  r   r}   r   r  r   nulls_last_opr  s     rv   _create_nulls_last"UnaryExpression._create_nulls_lastC  s1    
 U^^V4,,$)
 	
ry   c                z    [        [        R                  " [        R                  U5      [
        R                  SS9$ r  )rb  r   r}   r   r  r   desc_opr  s     rv   _create_descUnaryExpression._create_descN  s1     U^^V4&&$)
 	
ry   c                z    [        [        R                  " [        R                  U5      [
        R                  SS9$ r  )rb  r   r}   r   r  r   asc_opr  s     rv   _create_ascUnaryExpression._create_ascX  s1    
 U^^V4%%$)
 	
ry   c                    [         R                  " [        R                  U5      n[	        U[
        R                  UR                  SS9$ NFr^  rt   r  )r   r}   r   r  rb  r   distinct_opr  r[  ra  col_exprs      rv   _create_distinct UnaryExpression._create_distinctc  sD    
 '0&6&6'''
 **--$)	
 	
ry   c                    [         R                  " [        R                  U5      n[	        U[
        R                  UR                  SS9$ r  )r   r}   r   r  rb  r   bitwise_not_opr  r  s      rv   _create_bitwise_not#UnaryExpression._create_bitwise_notr  sD    
 '0&6&6'''
 ----$)	
 	
ry   c                z    [         R                  " U R                  5      (       a  U R                  R                  $ g rp   )r   is_order_by_modifierr}  rk  r   r   s    rv   r   'UnaryExpression._order_by_label_element  s*    ))$--88<<777ry   c                .    U R                   R                  $ rp   rk  r   r   s    rv   r   UnaryExpression._from_objects      ||)))ry   c                (   U R                   R                  [        R                  R                  L aM  [	        U R                  [        R                  S9[        R                  [        R                  U R                  S9$ [        R                  U 5      $ )Nr]  r  )r  r  r   r  rb  r=  r   r`  r  r   rY  r   s    rv   rY  UnaryExpression._negate  sk    99##x';';'J'JJ"	6"**(,(D(D	  !((..ry   c                    U R                   (       a1  [        R                  " U R                   U5      (       a  [        U 5      $ U $ rp   )r^  r   r  r  r;  s     rv   r=  UnaryExpression.self_group  s0     ==Y33DMM7KKD>!Kry   )r   rk  r}  r^  r  r  )NNNF)
rk  r  r^  ry  r}  ry  rt   r
  r  rI  )r  _ColumnExpressionArgument[_T]r   UnaryExpression[_T])r  z'_ColumnExpressionOrStrLabelArgument[_T]r   r  )ra  r  r   r  rt  ru  rp   r  )r   r   r   r   r   r   r7   r;  r  r  r}  r  r^  r  r  r  r  r  r  r  r   r=   r  r   rY  r=  r   rq   ry   rv   rb  rb    s    N 
%667	&223	&2233/  
 ,0+/37(-?#? )? )	?
 1? "&?* 
-
 

 
 
-
 

 
 
<
	
 
 
7
 

 
 
+
 

 
 
+
 

 
   
""* #*	/ 15-	" ry   rb  c                      \ rS rSrSrSrSr\    S
S j5       r\    S
S j5       r	        SS jr
        SS jrSrg	)CollectionAggregatei  zForms the basis for right-hand collection operator modifiers
ANY and ALL.

The ANY and ALL keywords are available in different ways on different
backends.  On PostgreSQL, they only work for an ARRAY type.  On
MySQL, they only work for subqueries.

Tc                    [         R                  " [        R                  U5      nUR	                  5       n[        U[        R                  [        R                  SS9$ r  )
r   r}   r   r  r=  r  r   r
  r   r  r  s      rv   _create_anyCollectionAggregate._create_any  U     '0&6&6'''
 &&("%%&&$)	
 	
ry   c                    [         R                  " [        R                  U5      nUR	                  5       n[        U[        R                  [        R                  SS9$ r  )
r   r}   r   r  r=  r  r   r  r   r  r  s      rv   _create_allCollectionAggregate._create_all  r  ry   c                    [         R                  " U5      (       d  [        R                  " S5      eSUS'   U R                  R
                  " [         R                  " U5      /UQ70 UD6$ )N2Only comparison operators may be used with ANY/ALLTreverse)r   r  r;   r3  r  r  mirrorr  s       rv   r  CollectionAggregate.operate  sa     &&r**##D  !y&&y'7'7';NeNvNNry   c                h    [         R                  " U5      (       a   e[        R                  " S5      e)Nr  )r   r  r;   r3  r  s       rv   r  #CollectionAggregate.reverse_operate  s1     **2....@
 	
ry   rq   N)ra  r  r   zCollectionAggregate[bool])r  rP   r8  r   r   r   r   r  )r   r   r   r   r   r  r  r^  r  r  r  r  r   rq   ry   rv   r  r    s     M#
0
	"
 
 
0
	"
 
$OO(+O7:O	O

'*
69
	
ry   r  c                  B    \ rS rSrSrS r\S 5       rS	S
S jjrS r	Sr
g)r  i  Tc                    Xl         [        R                  U l        X l        X0l        S U l        SU l        UR                  U l        g NT)	rk  r   r  r  r^  r  r}  r  r  )r   rk  r^  r  s       rv   r  AsBoolean.__init__  s;    ((	 '+$&-&D&D#ry   c                    U R                   $ rp   rm  r   s    rv   r  #AsBoolean.wrapped_column_expression  s    ||ry   Nc                    U $ rp   rq   r;  s     rv   r=  AsBoolean.self_group      ry   c                    [        U R                  [        [        45      (       a  U R                  R	                  5       $ [        U R                  U R                  U R                  5      $ rp   )r   rk  rh  r`  rY  r  r  r^  r   s    rv   rY  AsBoolean._negate  sE    dllUFO44<<''))T\\4;;FFry   )r  rk  r}  r  r^  r  r  rp   r&  )r   r   r   r   r  r  r  r  r=  rY  r   rq   ry   rv   r  r    s,    ME  Gry   r  c                     \ rS rSr% SrSrS\R                  4S\R                  4S\R                  4S\R                  4S\R                  4S	\R                  4/rS
\S'   S\R                  4S\R                  4S\R                  4S\R                  4S	\R                  4/rSr S\S'   S\S'   S\S'      S           SS jjr\  SS j5       rS r\R(                  (       a	      SS jr\R.                  SS j5       rS rSrg)r  i  a  Represent an expression that is ``LEFT <operator> RIGHT``.

A :class:`.BinaryExpression` is generated automatically
whenever two column expressions are used in a Python binary expression:

.. sourcecode:: pycon+sql

    >>> from sqlalchemy.sql import column
    >>> column("a") + column("b")
    <sqlalchemy.sql.expression.BinaryExpression object at 0x101029dd0>
    >>> print(column("a") + column("b"))
    {printsql}a + b

binaryr  r  r^  r  r  r  r\   r  Tr  rv  Nc                   [        U[        5      (       a  [        R                  " U5      nUR	                  5       UR	                  5       4U l        UR                  =(       d    UR                  U l        UR                  US9U l        UR                  US9U l	        X0l
        [        R                  " U5      U l        XPl        [        R                  " U5      U l        Uc  0 U l        g X`l        g r  )r   r   r   	custom_opr  _origr   r=  r  r  r^  r   r  r  r  r  r  r  )r   r  r  r^  rt   r  r  s          rv   r  BinaryExpression.__init__3  s     h$$ **84Hmmou~~'78
 $ 5 5 O9O9OOOHO5	%%h%7
  ((/	&/&:&:8&D#DN&Nry   c                2    U R                   U R                  4$ rp   )r  r  r   s    rv   r  ,BinaryExpression._flattened_operator_clausesR  s     		4::&&ry   c                    U R                   [        R                  [        R                  4;   a  U R                   " U R                  6 $ [        S5      e)aj  Implement Python-side "bool" for BinaryExpression as a
simple "identity" check for the left and right attributes,
if the operator is "eq" or "ne".  Otherwise the expression
continues to not support "bool" like all other column expressions.

The rationale here is so that ColumnElement objects can be hashable.
What?  Well, suppose you do this::

    c1, c2 = column("x"), column("y")
    s1 = set([c1, c2])

We do that **a lot**, columns inside of sets is an extremely basic
thing all over the ORM for example.

So what happens if we do this? ::

    c1 in s1

Hashing means it will normally use ``__hash__()`` of the object,
but in case of hash collision, it's going to also do ``c1 == c1``
and/or ``c1 == c2`` inside.  Those operations need to return a
True/False value.   But because we override ``==`` and ``!=``, they're
going to get a BinaryExpression.  Hence we implement ``__bool__`` here
so that these comparisons behave in this particular context mostly
like regular object comparisons.  Thankfully Python is OK with
that!  Otherwise we'd have to use special set classes for columns
(which we used to do, decades ago).

rg  )r^  r   eqner  rh  r   s    rv   ri  BinaryExpression.__bool__X  s>    < ==Y\\9<<88 ==$**--IJJry   c                    g rp   rq   r   s    rv   rZ  BinaryExpression.__invert__  s    #&ry   c                \    U R                   R                  U R                  R                  -   $ rp   )r  r   r  r   s    rv   r   BinaryExpression._from_objects  s!    yy&&)A)AAAry   c           	     4   U R                   bn  [        U R                  U R                  R	                  U R                   U R
                  5      U R                   U R
                  U R                  U R                  S9$ U R                  5       R                  5       $ )N)r  rt   r  )
r  r  r  r  r   r^  r  r  r=  rY  r   s    rv   rY  BinaryExpression._negate  sp    ;;"#		

,,T[[$--H}}ii..  ??$,,..ry   )	r  r  r   r  r  r  r^  r  r  )NNN)r  r  r  r  r^  rP   rt   r
  r  ry  r  rx  r  )r   BinaryExpression[_T]r   r  ru  )r   r   r   r   r   r   r7   r;  r  r  r  r  r}  r   r  r  r  r  ri  r  r   rZ  r=   r  r   rY  r   rq   ry   rv   r  r    s    N 
"334	#445	&223	$001	'556%%	

3/ 
 
"334	#445	&223	'556 %%	
 "
    48)-15' ' "' 	'
 1' '' /'> '	.' '
$KL 	'&	'!	' 
""B #B/ry   r  c                      \ rS rSr% SrSrS\R                  4S\R                  4S\R                  4/rS\	S'   SS
 jr
SSS jjrSrg	)Slicei  zRepresent SQL for a Python array-slice object.

This is not a specific SQL construct at this level, but
may be interpreted by specific dialects, e.g. PostgreSQL.

slicestartstopstepr\   r  Nc                ~   [         R                  " [        R                  UU[        R
                  S9U l        [         R                  " [        R                  UU[        R
                  S9U l        [         R                  " [        R                  UU[        R
                  S9U l        [        R                  U l
        g )N)r  rt   )r   r}   r   r  r   rd  r  r  r  r  r  )r   r  r  r  _names        rv   r  Slice.__init__  s    %%''&&	

 $$''&&	
	 $$''&&	
	 %%	ry   c                0    U[         R                  L d   eU $ rp   )r^  getitemr;  s     rv   r=  Slice.self_group  s    (*****ry   )r  r  r  r  rp   r&  )r   r   r   r   r   r   r7   r;  r  r}  r  r=  r   rq   ry   rv   r  r    s\     N 
#445	"334	"3343/ &* ry   r  c                      \ rS rSrSrSrSrg)IndexExpressioni  zFRepresent the class of expressions that are like an "index"
operation.Trq   N)r   r   r   r   r   r  r   rq   ry   rv   r  r    s     Mry   r  c                  <    \ rS rSr% SrSrS\S'   S
SS jjrS rS	r	g)GroupedElementi  z&Represent any parenthesized expressiongroupingr   rk  Nc                    U $ rp   rq   r;  s     rv   r=  GroupedElement.self_group  r  ry   c                6    U R                   R                  5       $ rp   )rk  r@  r   s    rv   r@  GroupedElement._ungroup  s    ||$$&&ry   rq   rp   r&  )
r   r   r   r   r   r   r}  r=  r@  r   rq   ry   rv   r  r    s    0N'ry   r  c                  p   \ rS rSr% SrS\R                  4S\R                  4/rS\	S'   S\R                  4/r
S\	S'     SS jrS	 r\R                  S
 5       r\R                   SS j5       r\R                   SS j5       r\R&                  SS j5       rS rS rS r\(       a   S   SS jjrSrgSrg)r  i  z/Represent a grouping within a column expressionrk  r  r\   r  0Union[TextClause, ClauseList, ColumnElement[_T]]c                r    Xl         [        US[        R                  5      U l        UR
                  U l        g )Nr  )rk  r  r   r  r  r   rn  s     rv   r  Grouping.__init__  s/      GVX->->?	 ' 8 8ry   c                V    U R                  U R                  R                  U5      5      $ rp   )r   rk  r   r   s     rv   r   "Grouping._with_binary_element_type  s     ~~dllDDUKLLry   c                .    U R                   R                  $ rp   rk  r  r   s    rv   r  Grouping._is_implicitly_boolean      ||222ry   c                V    [        U R                  SS 5      =(       d    U R                  $ r  )r  rk  ri  r   s    rv   r  Grouping._tq_label  s$     DLL+t4M8M8M	
ry   c                ^    [        U R                  [        5      (       a  U R                  /$ / $ rp   )r   rk  ra  r   s    rv   r  Grouping._proxies  s$    dllM22LL>!Iry   c                .    U R                   R                  $ rp   r  r   s    rv   r   Grouping._from_objects   r  ry   c                .    [        U R                  U5      $ rp   )r  rk  )r   attrs     rv   r#  Grouping.__getattr__  s    t||T**ry   c                4    U R                   U R                  S.$ )Nrk  r  r  r   s    rv   r  Grouping.__getstate__  s    <<;;ry   c                ,    US   U l         US   U l        g )Nrk  r  r  r  s     rv   r   Grouping.__setstate__
  s    Y'&M	ry   Nc                    g rp   rq   r;  s     rv   r=  Grouping.self_group  s    ry   )r   rk  r  )rk  r  rr  r  ru  rp   r&  )r   r   r   r   r   r7   r;  r  r  r}  r   r  r   r=   rz  r  r  r  r  r  r   r#  r  r   r   r=  r   rq   ry   rv   r  r    s	   9 
%667	"**+3/  
%667 >=9G9M 
3 3 

  

 
   
""* #*+<"  59	1		 	 ry   r  c                  H    \ rS rSrSrSr      SS jr      S	S jrSrg)
_OverrideBindsi  a  used by cache_key->_apply_params_to_element to allow compilation /
execution of a SQL element that's been cached, using an alternate set of
bound parameter values.

This is used by the ORM to swap new parameter values into expressions
that are embedded into loader options like with_expression(),
selectinload().  Previously, this task was accomplished using the
.params() method which would perform a deep-copy instead.  This deep
copy proved to be too expensive for more complex expressions.

See #11085

override_bindsc                    Xl         [        X25       VVs0 s H  u  pEUR                  UR                  _M     snnU l        g s  snnf rp   )rk  r  r  rs   	translate)r   rk  r  replaces_paramsr   r   s         rv   r  _OverrideBinds.__init__&  s=     '*?'G
'GtqAEE177N'G
 
s   #Ac                x   ^  / nT R                   R                  X5      nUR                  U 4S jU 5       5        U$ )zlgenerate a cache key for the given element, substituting its bind
values for the translation values present.c              3     >#    U  HI  nUR                   TR                  ;   a(  UR                  TR                  UR                      S SS9OUv   MK     g7f)TF)r.  r)  N)r  r  r  )r?  rW  r   s     rv   r@  0_OverrideBinds._gen_cache_key.<locals>.<genexpr>:  sZ      	
 # 66T^^+ NN266*   	 #s   AA)rk  r  extend)r   r]   r  existing_bpscks   `    rv   r  _OverrideBinds._gen_cache_key1  sB     24\\((@ 	
 #	
 		
 	ry   )rk  r  N)rk  r  r  rw  r  rw  )r]   r]   r  zList[BindParameter[Any]]r   z Optional[typing_Tuple[Any, ...]])	r   r   r   r   r   r   r  r  r   rq   ry   rv   r  r    sL     &N	
"	
 1	
 6		
 .F	)ry   r  c                      \ rS rSrSrSrSrg)
_OverRangeiH  r   r   rq   N)r   r   r   r   RANGE_UNBOUNDEDRANGE_CURRENTr   rq   ry   rv   r  r  H  s    OMry   r  c                     \ rS rSr% SrSrS\R                  4S\R                  4S\R                  4S\R                  4S\R                  4S	\R                  4/r	S
\
S'   SrS\
S'   SrS\
S'   S\
S'    S\
S'   S\
S'   S\
S	'        S           SS jjrS r    SS jr\(       d  \R$                  SS j5       r\R(                  SS j5       rSrg)OveriS  zRepresent an OVER clause.

This is a special operator against a so-called
"window" function, as well as any aggregate function,
which produces results relative to the result set
itself.  Most modern SQL backends now support window functions.

overrk  order_bypartition_byrange_rowsgroupsr\   r  NOptional[ClauseList]r  z0Optional[typing_Tuple[_IntOrRange, _IntOrRange]]c                   Xl         Ub2  [        [        R                  " U5      S[        R
                  06U l        Ub2  [        [        R                  " U5      S[        R
                  06U l        [        S XEU4 5       5      S:  a  [        R                  " S5      eU(       a  U R                  U5      OS U l        U(       a  U R                  U5      OS U l        U(       a  U R                  U5      OS U l        g )Nr  c              3  8   #    U  H  n[        U5      v   M     g 7frp   )rI  )r?  items     rv   r@   Over.__init__.<locals>.<genexpr>  s     =&<dtDzz&<s   r   z9only one of 'rows', 'range_', or 'groups' may be provided)rk  r|  r=   to_listr   r  r  r   sumr;   r3  _interpret_ranger!  r"  r#  )r   rk  r   r  r!  r"  r#  s          rv   r  Over.__init__s  s     &h'?D~~DM # *l+!&+nn!D
 =vV&<==A##K  <B$//7tDK7;--d3DI;A$//7tDKry   c                    U R                   U R                  U R                  U R                  U R                  U R
                  U R                  44$ rp   )r   rk  r   r  r!  r"  r#  r   s    rv   
__reduce__Over.__reduce__  sD    ~~LLMMKKIIKK 
 
 	
ry   c                   [        U[        5      (       a  [        U5      S:w  a  [        R                  " S5      eUu  p#Uc  [
        nO0[        U[        5      (       a  UnO [        U5      nUS:X  a  [        nUc	  [
        nXF4$ [        U[        5      (       a  UnXF4$  [        U5      nUS:X  a  [        nXF4$ ! [         a  n[        R                  " S5      UeS nAff = f! [         a  n[        R                  " S5      UeS nAff = f)Nr:   z2-tuple expected for range/rowsr   z(Integer or None expected for range value)
r   rH  r  r;   r3  r  r  r  r  
ValueError)r   r!  r0r1lowerr  uppers          rv   r+  Over._interpret_range  s    &%((CK1,<##$EFF
 :#EJ''E*B A:)E:#E | J''E |*B A:)E|/  ''>  ''>s0   "B:  C# :
C CC #
D	-DD	c                .    U R                   R                  $ rp   r  r   s    rv   r  	Over.type  s    <<$$$ry   c                    [        [        R                  " U R                  U R                  U R
                  4 Vs/ s H  nUc  M  UR                  PM     sn6 5      $ s  snf rp   )rQ  rI  rJ  rk  r   r  r   rK  s     rv   r   Over._from_objects  s[    OO #llD,=,=t}}MM $AOOM
 	
s   AA)rk  r#  r  r   r!  r"  NNNNN)rk  r  r   Optional[_ByArgument]r  r<  r!  4Optional[typing_Tuple[Optional[int], Optional[int]]]r"  r=  r#  r=  )r!  z:typing_Tuple[Optional[_IntOrRange], Optional[_IntOrRange]]r   z&typing_Tuple[_IntOrRange, _IntOrRange]r  ru  )r   r   r   r   r   r   r7   r;  r  r  r}  r  r   r  r.  r+  r   r=   rz  r  r  r   r   rq   ry   rv   r  r  S  s_    N 
%667	&778	*;;<	$112	"//0	$1123/  &*H"))-L&- =<
::<<
 /3*.GKEIGKL"L ,L (	L
 EL CL EL:
*J* 
0*X 				% 
 	% 
""	
 #	
ry   r  c                  Z   \ rS rSr% SrSrS\R                  4S\R                  4/rS\	S'   Sr
S	\	S'       SS
 jrS rSSSSSS.           SS jjr\SS j5       r\      SS j5       r    SS jr\(       d  \R$                  SS j5       r\R(                  SS j5       rSrg)WithinGroupi  a  Represent a WITHIN GROUP (ORDER BY) clause.

This is a special operator against so-called
"ordered set aggregate" and "hypothetical
set aggregate" functions, including ``percentile_cont()``,
``rank()``, ``dense_rank()``, etc.

It's supported only by certain database backends, such as PostgreSQL,
Oracle Database and MS SQL Server.

The :class:`.WithinGroup` construct extracts its type from the
method :meth:`.FunctionElement.within_group_type`.  If this returns
``None``, the function's ``.type`` is used.

withingrouprk  r  r\   r  Nr$  c                |    Xl         Ub3  [        [        R                  " U5      S[        R
                  06U l        g g )Nr  )rk  r|  r=   r)  r   r  r  )r   rk  r  s      rv   r  WithinGroup.__init__  s8    
 &h'?D~~DM  ry   c                    U R                   U R                  4U R                  b  [        U R                  5      -   4$ S-   4$ r  )r   rk  r  rH  r   s    rv   r.  WithinGroup.__reduce__  sG    ~~$(MM$=E$--  
 
 	
CE 
 
 	
ry   )r   r  r"  r!  r#  c          	         [        U UUUUUS9$ )zProduce an OVER clause against this :class:`.WithinGroup`
construct.

This function has the same signature as that of
:meth:`.FunctionElement.over`.

r   r  r!  r"  r#  r  )r   r   r  r"  r!  r#  s         rv   r  WithinGroup.over  s#      %
 	
ry   c                    g rp   rq   r   s    rv   filterWithinGroup.filter  s    !ry   c                    g rp   rq   )r   _WithinGroup__criterion0	criterions      rv   rJ  rK    s    
 !ry   c                ,    U(       d  U $ [        U /UQ76 $ )z.Produce a FILTER clause against this function.)FunctionFilter)r   rN  s     rv   rJ  rK  &  s     Kd/Y//ry   c                n    U R                   R                  U 5      nUb  U$ U R                   R                  $ rp   )rk  within_group_typer  )r   wgts     rv   r  WithinGroup.type0  s0    ,,006C
||(((ry   c                    [        [        R                  " U R                  U R                  4 Vs/ s H  nUc  M  UR
                  PM     sn6 5      $ s  snf rp   )rQ  rI  rJ  rk  r  r   rK  s     rv   r   WithinGroup._from_objects8  sS    OO #llDMM:: $AOO:
 	

   AA)rk  r  )rk  z.Union[FunctionElement[_T], FunctionFilter[_T]]r  rM  )r   r<  r  r<  r"  r=  r!  r=  r#  r=  r   Over[_T])r   rB   )rM  r  rN  r  r   zFunctionFilter[_T])rN  r  r   zUnion[Self, FunctionFilter[_T]]r  ru  )r   r   r   r   r   r   r7   r;  r  r}  r  r  r.  r  r   rJ  r   r=   rz  r  r  r   r   rq   ry   rv   r?  r?    sF     #N 
%667	&7783/ 
 &*H")	?	 2	
 /3*.EIGKGK
 ,
 (	

 C
 E
 E
 

2 ! !!5! 4! 
	! !090	(0 				) 
 	) 
""	
 #	
ry   r?  c                  Z   \ rS rSr% SrSrS\R                  4S\R                  4/rS\	S'   Sr
S	\	S'       SS
 jr\SS j5       r     S           SS jjr    SS jr    SS jr S   SS jjr\(       d  \R(                  SS j5       r\R,                  SS j5       rSrg)rP  iE  ak  Represent a function FILTER clause.

This is a special operator against aggregate and window functions,
which controls which rows are passed to it.
It's supported only by certain database backends.

Invocation of :class:`.FunctionFilter` is via
:meth:`.FunctionElement.filter`::

    func.count(1).filter(True)

.. seealso::

    :meth:`.FunctionElement.filter`


funcfilterfuncrN  r\   r  Nr  c                J    Xl         U R                  R                  " U /UQ76   g rp   )r[  rJ  non_generative)r   r[  rN  s      rv   r  FunctionFilter.__init__`  s     
 	""44)4ry   c                    [        U5       HQ  n[        R                  " [        R                  U5      nU R
                  b  U R
                  U-  U l        MK  X l        MS     U $ )zProduce an additional FILTER against the function.

This method adds additional criteria to the initial criteria
set up by :meth:`.FunctionElement.filter`.

Multiple criteria are joined together at SQL render time
via ``AND``.


)rQ  r   r}   r   r  rN  )r   rN  crits      rv   rJ  FunctionFilter.filterh  sP     OD##E$9$94@D~~)!%$!6!% $ ry   c           	         [        U UUUUUS9$ )a  Produce an OVER clause against this filtered function.

Used against aggregate or so-called "window" functions,
for database backends that support window functions.

The expression::

    func.rank().filter(MyClass.y > 5).over(order_by="x")

is shorthand for::

    from sqlalchemy import over, funcfilter

    over(funcfilter(func.rank(), MyClass.y > 5), order_by="x")

See :func:`_expression.over` for a full description.

rF  rG  )r   r   r  r!  r"  r#  s         rv   r  FunctionFilter.over  s$    H %
 	
ry   c                    [        U /UQ76 $ )zEProduce a WITHIN GROUP (ORDER BY expr) clause against
this function.
)r?  )r   r  s     rv   within_groupFunctionFilter.within_group  s     4+(++ry   c                    g rp   rq   )r   re  s     rv   rR   FunctionFilter.within_group_type  s     ry   c                p    [         R                  " [         R                  U5      (       a  [        U 5      $ U $ rp   )r   r  	filter_opr  r;  s     rv   r=  FunctionFilter.self_group  s,     !!)"5"5w??D>!Kry   c                .    U R                   R                  $ rp   )r[  r  r   s    rv   r  FunctionFilter.type  s    99>>!ry   c                    [        [        R                  " U R                  U R                  4 Vs/ s H  nUc  M  UR
                  PM     sn6 5      $ s  snf rp   )rQ  rI  rJ  r[  rN  r   rK  s     rv   r   FunctionFilter._from_objects  sS    OO #ii88 $AOO8
 	
rW  )rN  r[  )r[  z+Union[FunctionElement[_T], WithinGroup[_T]]rN  r  )rN  r  r   rB   r;  )r   YOptional[Union[Iterable[_ColumnExpressionArgument[Any]], _ColumnExpressionArgument[Any]]]r  rp  r!  r=  r"  r=  r#  r=  r   rX  )r  rM  r   WithinGroup[_T])re  rq  r   r  rp   r  r  ru  )r   r   r   r   r   r   r7   r;  r  r}  rN  r  r(   rJ  r  re  rR  r=  r   r=   rz  r  r  r   r   rq   ry   rv   rP  rP  E  sI   " "N 
"334	'8893/ 
 04I,3595 45  :  GKEIGK!+

+

+
 E+
 C+
  E!+
" 
#+
Z,7,	,+	! 15-	" 				" 
 	" 
""	
 #	
ry   rP  c                     \ rS rSr% SrSrS\S'   S\S'   S\S'   S	 r\R                  SS
 j5       r
\R                  SS j5       r\R                  SS j5       r\R                  S 5       r\R                  S 5       r S     SS jjr  S         SS jjrSSSSSS.                   SS jjrSrg)NamedColumni  FNOptional[FromClause]tabler   r  r  c                    [        US5      =(       a    U R                  UR                  :H  =(       d,    [        US5      =(       a    U R                  UR                  :H  $ )Nr  r  )rX  r  r  r  s     rv   rZ  $NamedColumn._compare_name_for_result  sD    v&B499

+B 
E8$D)D	
ry   c                    U R                   $ rp   r  r   s    rv   r   NamedColumn.description      yyry   c                    U R                   nU(       a   XR                  :w  a  U R                  U5      $ U R                  $ )ztable qualified label based on column key.

for table-bound columns this is <tablename>_<column key/proxy key>;

all other expressions it resolves to key/proxy key.

)r  r  _gen_tq_labelr  )r   r]  s     rv   r  NamedColumn._tq_key_label  s4     OO	ii/%%i00>>!ry   c                8    U R                  U R                  5      $ )ztable qualified label based on column name.

for table-bound columns this is <tablename>_<columnname>; all other
expressions it resolves to .name.

r}  r  r   s    rv   r  NamedColumn._tq_label  s     !!$)),,ry   c                    gr  rq   r   s    rv   r  +NamedColumn._render_label_in_columns_clause  r   ry   c                    U R                   $ rp   ry  r   s    rv   r  NamedColumn._non_anon_label   r{  ry   c                    U$ rp   rq   )r   r  dedupe_on_keys      rv   r}  NamedColumn._gen_tq_label  s	     ry   c           
     H    [        U R                  UUU R                  USUS9$ )NT)r,  r-  rt   r+  r.  )r0  r  r  r1  s        rv   r3  NamedColumn._bind_param	  s.     HH"*"ii
 	
ry   r  r  re  rf  disallow_is_literalc                  [        U(       a8  [        R                  " [        R                  U=(       d    U R
                  5      OU=(       d    U R
                  U R                  USS9n
UR                  U
l        Uc  U R                  U
l        U(       a  [        U5      U
l
        OU /U
l
        UR                  b4  UR                  R                  R                  U
R                  5      U
l        U
R                  U
4$ )NFrt   rh  r   )r   r   r}   r   rj  r  r  r   r  rQ  r  r   rk  rJ  )r   rl  r  r  r  r  re  rf  r  r   r   s              rv   rn  NamedColumn._make_proxy  s      '   !9!94;L499M'dii))"	
 (88<HHAE23AJAJ"".'44<<@@GANuuaxry   rq   r   rr  Tr  r   r  rI  r   rs  r(  )
r^  rP   r2  r   rt   r  r.  rI  r   r  rl  rV   r  rJ   r  r  r  rs  r  rs  re  rI  rf  r  r  rI  r   r   r   r  )r   r   r   r   r   ru  r}  rZ  r=   r|  r   r,   r  r  r  r  r  r}  r3  rn  r   rq   ry   rv   rs  rs    s   J"&E&
I	H

 
  ##" $" ##- $- ## $ ## $ 04(,	 +/

 
 (	

 
 

. #!$)GK$)"" 	"
 3" " " "" E" "" " 
-" "ry   rs  _PSc                  Z   \ rS rSr% SrSrS\R                  4S\R                  4S\R                  4/r
S\S'   S\R                  4S\R                  4/rS	\S'   S
\S'    S      S!S jjrS r\R                   S 5       rS"S jr\R(                  S 5       r\R                   S 5       r\S 5       r\R                   S#S j5       rS S$S jjrS r        S%S jr\S 5       r\S 5       r\SS.       S&S jjr \RB                  S'S j5       r"SSS.             S(S jjr#Sr$g))rt  iB  zRepresents a column label (AS).

Represent a label, as typically applied to any column-level
element using the ``AS`` sql keyword.

ru  r  r  _elementr\   r  r  r   Nc                H   Un[         R                  " [        R                  UU S9n[	        U[
        5      (       a#  UR                  n[	        U[
        5      (       a  M#  U(       a  Xl        OU[        R                  [        U 5      [        USS5      5      U l        [	        U[
        5      (       a  UR                  U l        U R                  =U l        =U l        U l        X l        Ub  [$        R&                  " U5      OU R"                  R(                  U l        U/U l        g )Nr  r  r|  )r   r}   r   r  r   rt  rk  r  r_  r~  rn  r  r  _resolve_labelr  r  r  r  r   r  r  r  )r   r  rk  rt   orig_elements        rv   r  Label.__init__Z  s     ""''"&

 %(( ooG %((
 I(774''66:DI ,.. '3&9&9#9=BB4>D$6     '## 		 !	ry   c                `    U R                   U R                  U R                  U R                  44$ rp   )r   r  r  r  r   s    rv   r.  Label.__reduce__  s$    ~~		4==$))DDDry   c                    gr  rq   r   s    rv   r  %Label._render_label_in_columns_clause  r   ry   Fc           
     4    [        S UUUU R                  SUS9$ r+  r/  r1  s        rv   r3  Label._bind_param  s(    "*"ii
 	
ry   c                .    U R                   R                  $ rp   r  r   s    rv   r  Label._is_implicitly_boolean  r  ry   c                .    U R                   R                  $ rp   )rk  r  r   s    rv   r  Label._allow_label_resolve  s    ||000ry   c                    U $ rp   rq   r   s    rv   r   Label._order_by_label_element  r%  ry   c                P    U R                   R                  [        R                  S9$ r  )r  r=  r   as_r   s    rv   rk  Label.element  s    }}''	'>>ry   c                J    U R                  U R                  R                  US9$ r  )_apply_to_innerr  r=  r;  s     rv   r=  Label.self_group  s"    ##DMM$<$<g#NNry   c                L    U R                  U R                  R                  5      $ rp   )r  r  rY  r   s    rv   rY  Label._negate  s    ##DMM$9$9::ry   c                n    U" U0 UD6nX@R                   La  [        U R                  X@R                  S9$ U $ Nr  )r  rt  r  r  )r   fnr  r   sub_elements        rv   r  Label._apply_to_inner  s5     #nnmm+KyyAAKry   c                .    U R                   R                  $ rp   )rk  r  r   s    rv   r  Label.primary_key  s    ||'''ry   c                .    U R                   R                  $ rp   )rk  r  r   s    rv   r  Label.foreign_keys  s    ||(((ry   )cloneanonymize_labelsc                  U R                  5         U" U R                  40 UD6U l        U(       aY  [        R                  [	        U 5      [        U R                  SS5      5      U l        U R                  =U l        =U l	        U l
        g g )Nr  r|  )_reset_memoizationsr  r_  r~  rn  r  rk  r  r  r  r  )r   r  r  r   s       rv   _copy_internalsLabel._copy_internals  sr     	  "dmm2r2(774'$,,?DI >BYYFDHFt~(:	 ry   c                .    U R                   R                  $ rp   r  r   s    rv   r   Label._from_objects  r  ry   )r  rf  c          
        U(       d  U R                   OUnU R                  R                  UUS[        U[        5      UUUS9u  pxXpR                   :w  aB  [        U R                   [
        5      (       d#  [        R                  " SU R                   -  5      eUR                  Ul        UR                  R                  U 5        U R                  b  U R                  Ul        U R                  U4$ )NT)r  r  re  rf  r  r  zLabel name %s is being renamed to an anonymous label due to disambiguation which is not supported right now.  Please use unique names for explicit labels.)r  rk  rn  r   _truncated_labelr_  r;   InvalidRequestErrorr   r  r  r  r  )	r   rl  r  r  r  rf  r   r  es	            rv   rn  Label._make_proxy  s     !%tyy$)) $ *41A B!5#% * 
" ))Jtyy:J$K$K))' +/))5  (88	

$99 YYAFxx{ry   )r  r  r  r  r  r  r  r  rp   )r  rs  rk  r  rt   r
  r(  r  )r<  ry  r   r  )r  z Callable[_PS, ColumnElement[_T]]r  z_PS.argsr   z
_PS.kwargsr   r  )r  r[   r  rI  r   r   r   r1  ru  )rl  rV   r  rJ   r  r  r  rs  rf  r  r   r   r   r  )%r   r   r   r   r   r   r7   r  r  r;  r  r}  r   r  r.  r,   r  r  r3  r=   rz  r  r  r  r   rk  r=  rY  r  r  r  r&   r  r  r   rn  r   rq   ry   rv   rt  rt  B  s9    N 
"//0	"**+	&7783/  
"//0	&778
  
I 48	%"%" /%" 1	%"NE ## $	
 
3 3 ##1 $1   ##? $?O;
,
 
 	

 

 ( ( ) ) %+!&	G "G 	G
 G 
G 
""* #* #GK** 	*
 3* * E* * 
-* *ry   rt  c                    ^  \ rS rSr% SrS\S'   S\S'   SrS\R                  4S	\R                  4S\R                  4S\R                  4/rS
\S'   SrS\S'   SrS\S'   SrS\S'   SrS\S'   Sr\S 5       r   S"       S#S jjrSS.S jr\U 4S j5       rS$U 4S jjr\S%S j5       r\R6                  S 5       r\S 5       rS r S&     S'S jjrSSSSSS.                   S(S  jjr S!r!U =r"$ ))r   i  a  Represents a column expression from any textual string.

The :class:`.ColumnClause`, a lightweight analogue to the
:class:`_schema.Column` class, is typically invoked using the
:func:`_expression.column` function, as in::

    from sqlalchemy import column

    id, name = column("id"), column("name")
    stmt = select(id, name).select_from("user")

The above statement would produce SQL like:

.. sourcecode:: sql

    SELECT id, name FROM user

:class:`.ColumnClause` is the immediate superclass of the schema-specific
:class:`_schema.Column` object.  While the :class:`_schema.Column`
class has all the
same capabilities as :class:`.ColumnClause`, the :class:`.ColumnClause`
class is usable by itself in those cases where behavioral requirements
are limited to simple SQL expression generation.  The object has none of
the associations with schema-level metadata or with execution-time
behavior that :class:`_schema.Column` does,
so in that sense is a "lightweight"
version of :class:`_schema.Column`.

Full details on :class:`.ColumnClause` usage is at
:func:`_expression.column`.

.. seealso::

    :func:`_expression.column`

    :class:`_schema.Column`

rt  ru  rI  r   r  r  r  r\   r  NzOptional[DefaultGenerator]onupdater   zOptional[FetchedValue]server_defaultserver_onupdateFc                F    U R                   =(       a    U R                  S:H  $ r%  )r   r  r   s    rv   r  ColumnClause._is_star>  s    3499#33ry   c                n    U=U l         U l        X@l        [        R                  " U5      U l        X0l        g rp   )r  r  ru  r   r  r  r   )r   r   rt   r   rh  s        rv   r  ColumnClause.__init__B  s0      $#49 
 ((/	$ry   )column_tablesc                   / $ rp   rq   )r   r  r   s      rv   r   ColumnClause.get_childrenR  s	     	ry   c                ^   > U R                   b  U R                   R                  $ [        TU ]  $ rp   )ru  r   r  )r   r   s    rv   r   ColumnClause.entity_namespaceX  s(    ::!::...7++ry   c                  > U(       ai  U R                   b\  U R                   R                  (       aA  UR                  S5      nU" U R                   40 UD6nUR                  R	                  U 5      nU$ [
        TU ]  " S0 UD6$ )Nr  rq   )ru  _is_subqueryr  r   corresponding_columnr  r&   )r   r/  r   r  ru  newr   s         rv   r&   ColumnClause._clone_  sh     

&

''FF7OE$**++E''..t4CJw~###ry   c                *    U R                   nUb  U/$ / $ rp   ru  )r   ts     rv   r   ColumnClause._from_objectsl  s    JJ=3JIry   c                    U R                   S L$ rp   r  r   s    rv   r  ,ColumnClause._render_label_in_columns_clauset  s    zz%%ry   c                6    U R                  U R                  SS9$ )NF)r  r  r   s    rv   
_ddl_labelColumnClause._ddl_labelx  s    !!$))5!AAry   c                :   U R                   (       d  U R                  bz  U R                  R                  (       d_  [        US5      (       aN  [	        U[
        5      (       a  UR                   (       d(  UR                  b  UR                  R                  (       a_  [        US5      =(       a    U R                  UR                  :H  =(       d,    [        US5      =(       a    U R                  UR                  :H  $ UR                  R                  U R                  5      $ )NrC  r  r  )
r   ru  r  rX  r   r   r  r  rC  rU  r  s     rv   rZ  %ColumnClause._compare_name_for_result|  s    OOzz!zz%%5+..5,//$${{*{{.. E6*FtyyEJJ/F {+ 6NNeoo5
 ??//??ry   c                   U R                   nU R                  (       a  gUGb  [        U5      (       Ga  [        U5      (       aD  UR                  (       a3  UR                  R                  SS5      S-   UR                  -   S-   U-   nO4[        (       a  [        U[        5      (       d   eUR                  S-   U-   n[        U5      (       aE  UR                  b8  [        U5      (       a  UR                  Ul        O}[        XAR                  5      nOg[        UR                  5      (       aM  UR                  R                  b6  [        U[        5      (       a   e[        XCR                  R                  5      nU(       aK  XCR                  ;   a<  UnSnXSR                  ;   a'  US-   [        U5      -   nUS-  nXSR                  ;   a  M'  Un[        R                   " ["        R$                  U5      $ U$ )zgenerate table-qualified label

for a table-bound column this is <tablename>_<columnname>.

used primarily for LABEL_STYLE_TABLENAME_PLUS_COL
as well as the .columns collection on a Join object.

N.ry  r   )ru  r   r!   r    schemareplacer  r   r   rW   r"   r  r  r   r   r   r}   r   rj  )r   r  r  r  ru  r  counters          rv   r}  ColumnClause._gen_tq_label  sz    JJ??]3A66q!!ahh((c2S8166ACG$N(=Jq/,J,JJJt+ d##

(>!%(("&**EK'zz:E''AFFLL,D &e[9999#E66<<8 CC<"FG CC-!&s7|!;1 !CC- #E##E$<$<eDD Kry   r  c               z   U(       + =(       a,    U R                   =(       a    US L =(       d    X@R                  :H  n
U R                  U(       a8  [        R                  " [
        R                  U=(       d    U R                  5      OU=(       d    U R                  U R                  UU
S9nUR                  Ul        Uc  U R                  Ul	        U(       a  [        U5      Ul        OU /Ul        UR                  b4  UR                  R                  R                  UR                  5      Ul        UR                  U4$ )Nr  )r   r  r   r   r}   r   rj  r  r   r  rQ  r  r   rk  rJ  )r   rl  r  r  r  r  re  rf  r  r   r   r   s               rv   rn  ColumnClause._make_proxy  s   ( $# 
  %99$ 	  '   !9!94;L499M'dii))"!  	
 (88<HHAE23AJAJ"".'44<<@@GANuuaxry   )r   r  r  ru  r  )NFN)r   r   rt   r
  r   rI  rh  rt  r  ru  r  r  r  )#r   r   r   r   r   r}  r   r7   r  r  r;  r  r  r  r   r  r  _is_multiparam_columnr  r  r  r   r   r&   r>   r   r,   r  r  r  rZ  r}  rn  r   r  r   s   @rv   r   r     s   %N  N 
"//0	"**+	#445	(334	3/  ,0H(/*.G'.-1N*1.2O+2!4 4 48 ,0%% 1% 	%
 *%  -2  , ,$ ' ' ##& $& B B@. 0466(,6	6| #!$)GK$)11 	1
 31 1 1 "1 E1 "1 1 
-1 1ry   r   c                      \ rS rSr% SrS\R                  4S\R                  4S\R                  4/r	S\
S'   SS jr\4     SS	 jjr\R                  SS
 j5       rSrg)TableValuedColumni  table_valued_columnr  r  scalar_aliasr\   r  c                L    Xl         UR                  =U l        U l        X l        g rp   )r  r  r  r  )r   r  rt   s      rv   r  TableValuedColumn.__init__  s!    (+00049	ry   c                x    U" U R                   40 UD6U l         U R                   R                  =U l        U l        g rp   )r  r  r  )r   r  r   s      rv   r  !TableValuedColumn._copy_internals  s6     "$"3"3:r:#0055549ry   c                    U R                   /$ rp   )r  r   s    rv   r   TableValuedColumn._from_objects  s    !!""ry   )r  r  r  r  N)r  rW   rt   r  )r  r[   r   r   r   r1  ru  )r   r   r   r   r   r7   r  r  r;  r  r}  r  r&   r  r=   r  r   r   rq   ry   rv   r  r    s    *N 
"//0	"**+	*;;<3/  +16'68;6	6 
""# ##ry   r  c                      \ rS rSr% SrS\R                  4/rS\S'   \	\
R                  " S5            S
S j5       5       rS rSrg	)r  i  rs  r\   r  r  c                j   [         R                  R                  n[        R                  " [
        R                  [           U5      nUR                  R                  UR                  L a  UR                  R                  U5      nOUR                  n[        U[        U5      [        R                  US9$ r  )r=   r   r  r   r}   r   r  r   r  r  String_with_collationr  r  r   rt  )r[  r6  rs  r  ra  collate_types         rv   _create_collation_expression,CollationClause._create_collation_expression  s     >>.. ; ;C @*M99##x69944Y?L99LI&	
 	
ry   c                    Xl         g rp   rs  rr  s     rv   r  CollationClause.__init__4  s    "ry   r  N)r6  z_ColumnExpressionArgument[str]rs  r   r   zBinaryExpression[str])r   r   r   r   r   r7   rP  r  r}  r^  r=   r   r  r  r   rq   ry   rv   r  r    sm     N 
'1123/  	23
7
DG
	
 4 
(#ry   r  c                      \ rS rSrSrS rSrg)_IdentifiedClausei8  
identifiedc                    Xl         g rp   ident)r   r  s     rv   r  _IdentifiedClause.__init__;  s    
ry   r  N)r   r   r   r   r   r  r   rq   ry   rv   r  r  8  s    !Nry   r  c                      \ rS rSrSrSrSrg)SavepointClausei?  	savepointFrq   Nr   r   r   r   r   r  r   rq   ry   rv   r  r  ?  s     NMry   r  c                      \ rS rSrSrSrSrg)RollbackToSavepointClauseiD  rollback_to_savepointFrq   Nr  rq   ry   rv   r
  r
  D  s    ,NMry   r
  c                      \ rS rSrSrSrSrg)ReleaseSavepointClauseiI  release_savepointFrq   Nr  rq   ry   rv   r  r  I  s    (NMry   r  c                     ^  \ rS rSr% SrSrS\S'   \\SS j5       5       r	\\SS j5       5       r	\      SS j5       r	SU 4S	 jjr
S
 rS rS rSrU =r$ )r  iN  a:  Represent a SQL identifier combined with quoting preferences.

:class:`.quoted_name` is a Python unicode/str subclass which
represents a particular identifier name along with a
``quote`` flag.  This ``quote`` flag, when set to
``True`` or ``False``, overrides automatic quoting behavior
for this identifier in order to either unconditionally quote
or to not quote the name.  If left at its default of ``None``,
quoting behavior is applied to the identifier on a per-backend basis
based on an examination of the token itself.

A :class:`.quoted_name` object with ``quote=True`` is also
prevented from being modified in the case of a so-called
"name normalize" option.  Certain database backends, such as
Oracle Database, Firebird, and DB2 "normalize" case-insensitive names
as uppercase.  The SQLAlchemy dialects for these backends
convert from SQLAlchemy's lower-case-means-insensitive convention
to the upper-case-means-insensitive conventions of those backends.
The ``quote=True`` flag here will prevent this conversion from occurring
to support an identifier that's quoted as all lower case against
such a backend.

The :class:`.quoted_name` object is normally created automatically
when specifying the name for key schema constructs such as
:class:`_schema.Table`, :class:`_schema.Column`, and others.
The class can also be
passed explicitly as the name to any function that receives a name which
can be quoted.  Such as to use the :meth:`_engine.Engine.has_table`
method with
an unconditionally quoted name::

    from sqlalchemy import create_engine
    from sqlalchemy import inspect
    from sqlalchemy.sql import quoted_name

    engine = create_engine("oracle+oracledb://some_dsn")
    print(inspect(engine).has_table(quoted_name("some_table", True)))

The above logic will run the "has table" logic against the Oracle Database
backend, passing the name exactly as ``"some_table"`` without converting to
upper case.

.. versionchanged:: 1.2 The :class:`.quoted_name` construct is now
   importable from ``sqlalchemy.sql``, in addition to the previous
   location of ``sqlalchemy.sql.elements``.

)r  r4  r5  r  r  c                    g rp   rq   r[  rs   r  s      rv   r  quoted_name.construct  s    JMry   c                    g rp   rq   r  s      rv   r  r    s    DGry   c                     Uc  g [        X5      $ rp   )r  r  s      rv   r  r    s     =u,,ry   c                   > Uc   S5       e[        X5      (       a  Ub  UR                  U:X  a  U$ [        TU ]  X5      nX#l        U$ )Nz0use quoted_name.construct() for None passthrough)r   r  r  r   )r[  rs   r  r   r   s       rv   r   quoted_name.__new__  sP    	>=	>e!!u}u8LLws*
ry   c                <    [         [        U 5      U R                  44$ rp   )r  r   r  r   s    rv   r.  quoted_name.__reduce__  s    SY

333ry   c                Z    U R                   (       a  U $ [        U 5      R                  5       $ rp   )r  r   r4  r   s    rv   _memoized_method_lower"quoted_name._memoized_method_lower      ::Kt9??$$ry   c                Z    U R                   (       a  U $ [        U 5      R                  5       $ rp   )r  r   r5  r   s    rv   _memoized_method_upper"quoted_name._memoized_method_upper  r  ry   )r  )rs   r   r  r  r   r  )rs   r1  r  r  r   r1  )rs   rs  r  r  r   zOptional[quoted_name])r   r   r   r   r   r   r}  r   r^  r  r   r.  r  r  r   r  r   s   @rv   r  r  N  s    .` *IM  MG  G-!-*8-	- -	4%% %ry   r  c                L    [        5       n[        U 0 SUR                  05        U$ )z2locate Column objects within the given expression.r  )setr8   r   )r   r>  s     rv   _find_columnsr"    s%     $'5DVR(DHH-.Kry   r  c                    U  H,  nUR                   R                  (       a  M   UR                   s  $    [        R                  $ rp   )r  r  r   r  )argsas     rv   _type_from_argsr&    s0    vv~~~66M     ry   c           
         U R                  XS9nUc8  [        R                  " SU< S[        USS 5      < SU R                  < S35      eU$ )N)require_embeddedzGiven column 'z', attached to table 'ru  z7', failed to locate a corresponding column from table '')r  r;   r  r  r   )
fromclauser  r(  r   s       rv   _corresponding_column_or_errorr+    sY    '' 	( 	A 	y%% wvw5z7M7MO
 	

 Hry   c                      \ rS rSrSrS rSrg)#_memoized_property_but_not_nulltypei  z,memoized property, but dont memoize NullTypec                    Uc  U $ U R                  U5      nUR                  (       d  X1R                  U R                  '   U$ rp   )fgetr  r   r   )r   r2  r[  results       rv   __get__+_memoized_property_but_not_nulltype.__get__  s5    ;K3~~*0LL'ry   rq   N)r   r   r   r   r   r1  r   rq   ry   rv   r-  r-    s     7ry   r-  c                    ^  \ rS rSr% S\S'   S rU 4S jr\R                  S 5       r	\
S 5       r\R                  S 5       r\R                  S	 5       r\R                  SS
 j5       r\R                  SS j5       rSrU =r$ )AnnotatedColumnElementi  r  _Annotated__elementc                   [         R                  " XU5        S H  nU R                  R                  US 5        M!     S H=  nU R                  R	                  US5      b  M"  U R                  R                  U5        M?     g )N)r  r  r  r  r  r  )r  r  ru  F)r$   r  r   r  rJ  )r   rk  r   r  s       rv   r  AnnotatedColumnElement.__init__  si    4&1
D MMdD)
 -D}}  u-5!!$' -ry   c                p   > [         TU ]  U5      nS H  nUR                  R                  US 5        M!     U$ )N)r  r  r  r  r  )r  _with_annotationsr   r  )r   r   r  r  r   s       rv   r9  (AnnotatedColumnElement._with_annotations  s;    )&1
D NNtT*
 ry   c                .    U R                   R                  $ )z'pull 'name' from parent, if not present)r5  r  r   s    rv   r  AnnotatedColumnElement.name  s     '',,,ry   c                .    U R                   R                  $ )a  pull 'type' from parent and don't cache if null.

type is routinely changed on existing columns within the
mapped_column() initialization process, and "type" is also consulted
during the creation of SQL expressions.  Therefore it can change after
it was already retrieved.  At the same time we don't want annotated
objects having overhead when expressions are produced, so continue
to memoize, but only when we have a non-null type.

)r5  r  r   s    rv   r  AnnotatedColumnElement.type  s     '',,,ry   c                .    U R                   R                  $ )z(pull 'table' from parent, if not present)r5  ru  r   s    rv   ru  AnnotatedColumnElement.table  s     ''---ry   c                .    U R                   R                  $ )z&pull 'key' from parent, if not present)r5  r  r   s    rv   r  AnnotatedColumnElement.key  s     ''+++ry   c                    [         (       a!  [        U R                  [        5      (       d   eU R                  R                  $ rp   )r   r   r5  rQ   infor   s    rv   rD  AnnotatedColumnElement.info  s2    =d66????'',,,ry   c                .    U R                   R                  $ rp   )r5  ri  r   s    rv   ri  'AnnotatedColumnElement._anon_name_label  s    ''888ry   rq   )r   rG   r   )r   r   r   r   r}  r  r9  r=   rz  r  r-  r  ru  r  rD  ri  r   r  r   s   @rv   r4  r4    s    ++(
 
- - )- )- 
. . 
, , 
- -
 
9 9ry   r4  c                  L   ^  \ rS rSrSrSrSSU 4S jjjrS	S jrS
S jrSr	U =r
$ )r  i   zRA unicode subclass used to identify symbolic "
"names that may require truncation.rq   c                >   > [        USU5      n[        TU ]	  XU5      $ )Nr  )r  r  r   )r[  rs   r  r   s      rv   r   _truncated_label.__new__&  s"    w.ws511ry   c                H    U R                   [        U 5      U R                  44$ rp   )r   r   r  r   s    rv   r.  _truncated_label.__reduce__+  s    ~~D	4::666ry   c                    U $ rp   rq   r   map_s     rv   	apply_map_truncated_label.apply_map.  r  ry   rp   )rs   r   r  r  r   r   r  )rO  rv  r   r   )r   r   r   r   r   r   r   r.  rP  r   r  r   s   @rv   r  r     s(    + I2 2
7 ry   r  c                      \ rS rSrSrSrSrg)convi2  a  Mark a string indicating that a name has already been converted
by a naming convention.

This is a string subclass that indicates a name that should not be
subject to any further naming conventions.

E.g. when we create a :class:`.Constraint` using a naming convention
as follows::

    m = MetaData(
        naming_convention={"ck": "ck_%(table_name)s_%(constraint_name)s"}
    )
    t = Table(
        "t", m, Column("x", Integer), CheckConstraint("x > 5", name="x5")
    )

The name of the above constraint will be rendered as ``"ck_t_x5"``.
That is, the existing name ``x5`` is used in the naming convention as the
``constraint_name`` token.

In some situations, such as in migration scripts, we may be rendering
the above :class:`.CheckConstraint` with a name that's already been
converted.  In order to make sure the name isn't double-modified, the
new name is applied using the :func:`_schema.conv` marker.  We can
use this explicitly as follows::


    m = MetaData(
        naming_convention={"ck": "ck_%(table_name)s_%(constraint_name)s"}
    )
    t = Table(
        "t",
        m,
        Column("x", Integer),
        CheckConstraint("x > 5", name=conv("ck_t_x5")),
    )

Where above, the :func:`_schema.conv` marker indicates that the constraint
name here is final, and the name will render as ``"ck_t_x5"`` and not
``"ck_t_ck_t_x5"``

.. seealso::

    :ref:`constraint_naming_conventions`

rq   Nr  rq   ry   rv   rS  rS  2  s    -^ Iry   rS  c                  \    \ rS rSrSrSr\  S	         S
S jj5       rS rS r	S r
Srg)r_  il  z@A unicode subclass used to identify anonymously
generated names.rq   Nc                    [         R                  " SSU5      nU(       a  UR                  S5      nSXR                  SS5      4-  nU(       a  U< U< 3n[	        U5      $ )Nz[%\(\) \$]+ry  z
%%(%d %s)s%%%)rQ  r/  stripr  r_  )r[  r  bodyr{  r  ru  s         rv   r~  _anonymous_label.safe_constructr  sV     vvnc40::c?Dll3&=>>-u5E&&ry   c                    SU;   a1  [        U[        5      (       d  [        U5      R                  SS5      nO[        U5      n[        [	        [        R                  X5      U R                  5      5      $ NrV  rW  r   r_  r   r  r  r  r  r  s     rv   r  _anonymous_label.__add__  s]    %<
52B C CJ&&sD1EJED(


 	
ry   c                    SU;   a1  [        U[        5      (       d  [        U5      R                  SS5      nO[        U5      n[        [	        [        R                  X5      U R                  5      5      $ r\  r]  r  s     rv   r  _anonymous_label.__radd__  s]    %<
52B C CJ&&sD1EJEE(


 	
ry   c                T    U R                   b  [        X-  U R                   5      $ X-  $ rp   )r  r  rN  s     rv   rP  _anonymous_label.apply_map  s)    ::!t{DJJ77 ;ry   r(  )
r  r  rY  r   r{  rs  r  rI  r   r_  )r   r   r   r   r   r   r^  r~  r  r  rP  r   rq   ry   rv   r_  r_  l  sg     I
 *."'' ' '	'
 ' 
' '*

ry   r_  r  )rs   r   rt   rK  ru   rI  r   r  r(  )rs   rf   rt   r1  ru   rI  r   r  )rs   r   rt   r  ru   rI  r   r0  rp   )r   r   rt   r
  r   zColumnClause[_T])r   r   r   zSet[ColumnClause[Any]])r$  zSequence[ColumnElement[_T]]r   r  )r   
__future__r   decimalr   enumr   rI  r^  rQ  r  r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   typing_Tupler   r   r   r   rz  r   r   r   r   r   _typingr    r!   r"   r#   
annotationr$   r%   baser&   r'   r(   r)   r*   r+   r,   r-   r.   r/   rE  r0   r1   r2   r3   r4   visitorsr5   r6   r7   r8   r9   r;   r<   r=   r>   r?   util.typingr@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   compilerrM   rN   	functionsrO   rP   r  rQ   rR   rS   rT   rl  rU   rV   rW   rX   r  rY   rZ   r[   r\   r]   enginer^   r_   engine.interfacesr`   ra   rb   rc   rd   engine.resultre   floatrl   r  rn   rf   rh   rj   rk   rm   rw   r   r   _self_inspectsr   r  DMLColumnRoleDDLConstraintColumnRoleColumnsClauseRoler  r  r  r  _SQOColumnArgumentOrKeyRoleStatementOptionRoler  BinaryElementRoleOrderByRoleLimitOffsetRoleDDLExpressionRolera  r  r  InElementRoler0  r  FromClauseRoleSelectStatementRoleInspectabler  ConstExprRolerT  _create_singletonrI  r`  rh  r|  r  r  r  r  r  r(  rq  rM  rP  r_  ri  rt  rb  r  r  r  r  r  r  r  r  r  r  r  _IntOrRanger  r?  rP  rs  r  r<  rt  DDLReferredColumnRoleStrAsPlainColumnRoler   r  r   r  r  r  r
  r  MemoizedSlotsr  r"  r&  r+  rz  r-  r4  r  rS  _generated_labelr_  rq   ry   rv   <module>r     s  
 #     	                 (           $ ) # " ! 3           # *  . & ( % + '      4  ! # 	$2<$",,1#"%*'($"+&+)#$,0"# ;.5?:& 
sG#
$Tsd3vU#e:&vY' 
 ""  	 
 
 !  	 
 
 15!-  	 
 15!""-" " 	"L ;?#<
#<7#<#<L]#i ]#@ yy yx- .%		!!		%*xG xGvee99%@*( r	5	!!			B					!!	r	5jr* ?"M"- ?"D[
E'');B)? [
|$ $A	!!								C <(AHe11$7t9L 4    !u**40-2E!8    ! u2248-:M ! H    i				iXU
r* U
p\
-b1 \
~M7,T2 M7` JJl38&<= JZ^
= ^
B9 $ 9xd2h  =&r* =@'mC  '.}R( :(}S1 (RmB' RjA
/"- A
HG%d+_T-B G4U/)"- U/p'M# 'T&s+ '( '=~}R0 =@0Xb\ 0f 
 ,,((CO$C
= C
Li
-# i
XL
Zr!2 L
^h$R( hV xE''+[_ xv~		#	O~B#B #2#mC( #B
M ' 
 1 
. 
^%$$$c ^%B!
+,C9Y C9L{ $0 0n $ <' <ry   