
    -h                        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rSrSrSrSrSr	S rS rS rS r   SqS jrS rS r " S S\5      r " S S\5      r " S S\5      r " S S\5      r  " S S\5      r!S\RD                  SS4S  j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/ S0\*\5      r+ " S1 S2\5      r, " S3 S4\%\!\5      r- " S5 S6\%\!\5      r. " S7 S8\%\5      r/ " S9 S:\$\5      r0 " S; S<\ \5      r1 " S= S>\%\5      r2 " S? S@\%\!\\Rf                  5      r4 " SA SB\4\5      r5 " SC SD\4\5      r6 " SE SF\ \5      r7 " SG SH\5      r8 " SI SJ\\5      r9 " SK SL\\%\5      r: " SM SN\\ \5      r; " SO SP\;5      r< " SQ SR\5      r= " SS ST\*5      r> " SU SV\'\%\5      r? " SW SX\5      r@ " SY SZ\%\5      rA " S[ S\\$\5      rB " S] S^\@5      rC " S_ S`\5      rD " Sa Sb\5      rE " Sc Sd\'\$\5      rF " Se Sf\F5      rG " Sg Sh\G5      rH " Si Sj\'\$\5      rI " Sk Sl\$\5      rJ " Sm Sn\$\5      rK0 rL\M" \5       HX  rN\O" \\N5      rP\NR                  So5      (       d  M$  \NR                  SoSp5      rN\N\S" 5       ;   d  MC  \S" 5       \N   " \P5      rT\T\L\P'   MZ     g)r    N   )	operators)roles)visitors)ExecutableOption)Options)HasCacheKey)	Visitable   )exc)
inspection)util)collections_abcc                 |    [        U [        [        R                  45      (       + =(       a    [	        U S5      (       + $ )z`Return whether or not the element is a "literal" in the context
of a SQL expression construct.

__clause_element__)
isinstancer
   schemaSchemaEventTargethasattr)elements    mC:\Users\ROHAN GUPTA\OneDrive\Desktop\mathbuddy-assessment\venv\Lib\site-packages\sqlalchemy/sql/coercions.py_is_literalr       s<     001
 	
 	7 !566    c                    [        U [        R                  5      (       a1  [        U [        5      (       d  U  H  n[	        U5      (       a  M    g   g[        U [
        [        R                  [        [        [        R                  R                  45      (       + =(       aI    [        U S5      (       + =(       a1    [        U [        5      (       + =(       d    [        U [        5      (       + $ )a  Return whether or not the element is a "literal" in the context
of a SQL expression construct.

does a deeper more esoteric check than _is_literal.   is used
for lambda elements that have to distinguish values that would
be bound vs. not without any context.

FTr   )r   r   Sequencestr_deep_is_literalr
   r   r   r	   r   r   langhelpers_symbolr   type
issubclass)r   elems     r   r   r   /   s     '?3344Z> > D#D))   ((  ((	
 		
 	
 !566	
 7D)) 4g{33r   c                 B    [         R                  " U SU< SU< S35      $ )Nz.. warning:: The z argument to z can be passed as a Python string argument, which will be treated as **trusted SQL text** and rendered as given.  **DO NOT PASS UNTRUSTED INPUT TO THIS PARAMETER**.)r   add_parameter_text)	paramnamemeth_rst	param_rsts      r   _document_text_coercionr(   U   s$    "" h	 
 
r   c                     U(       an  [        US   [        [        [        45      (       aK  [	        U5      S:X  a<  [        US   [        5      (       a  [
        R                  " SU < SU< S35        US   $ U$ )Nr   r   zThe "z" argument to zt(), when referring to a sequence of items, is now passed as a series of positional elements, rather than as a list. )r   listsetdictlenr   warn_deprecated_20)attrnamefnnameargss      r   !_expression_collection_was_a_listr2   c   sc    
47T3$5663t9>d1gt$$## 8@I
 Awr   c           	      ~   U R                   (       aK  [        U5      (       a;  [        US5      (       a*  [        R	                  UU [        R
                  " S
0 UD6US9$ [        U    nUn[        U[        R                  [        R                  [        R                  [        R                  45      (       Gd  S nUR                  (       a  UR                  " U40 UD6nGO'UnSn	UR                   (       a$  [        X5      (       a  [        US5      (       a  Sn	OJ[        US5      (       a9  Sn	[#        USS5      (       d  UR%                  5       nOO[        US5      (       a  M9  U	(       df  UR&                  (       a<  [(        R*                  " USS9n
U
b$  U(       a  U
R,                     U
R%                  5       nUc  UR                  " U4SU0UD6nO7UnO4[        U[        R                  5      (       a  UR2                  " S
0 UD6nOUnUb3  UR4                  (       d"  UR4                  (       a  UR4                  Ul        UR6                  UR8                  R:                  ;   a)  UR<                  (       a  UR<                  " U4UUS	.UD6nU$ UR>                  " Xx4SU0UD6$ ! [.         a    UR1                  Xs5         GNf = f)N__code__)apply_propagate_attrsFr   Tis_clause_element)raiseerrargname)r8   original_element ) allows_lambdacallabler   lambdasLambdaElementLambdaOptions_impl_lookupr   elementsClauseElementr   
SchemaItemFetchedValue	PyWrapper_resolve_literal_only_literal_coercion$_skip_clauseelement_for_target_matchgetattrr   _use_inspectionr   inspect_post_inspectAttributeError_raise_for_expected_sa__py_wrapper_literal_propagate_attrs_role_class	__class____mro___post_coercion_implicit_coercions)roler   r5   r8   post_inspectkwimplr9   resolvedr6   insps              r   expectr\   p   s    	
 WGZ(($$!!'B'"7	 % 
 	
 D""		
  %%--g<<H  ' % 99w--G%9::$(!g';<<(,%"7,?GG")"<"<"> g';<< %''%--gFD'' ..P'+'>'>'@H ##55 )0 46 H #	GW..	/	/228R8)%66%%191J1J.8--555**!1 	H ''
07
;=
 	
=  . P 445EOPs   %J J<;J<c                 $    SUS'   [        X40 UD6$ )NTas_key)r\   )rV   r   rX   s      r   expect_as_keyr_      s    BxL$&2&&r   c              #      #    U Ht  nS nS n[        X5      n[        U[        R                  5      (       a  U=p5O2/ n[        R
                  " U0 SUR                  05        U(       a  US   nUb  UOUnXTX74v   Mv     g 7f)Ncolumnr   )r\   r   r   string_typesr   traverseappend)rV   expressionsexprstrnamera   rZ   colsadd_elements           r    expect_col_expression_collectionrj      s     $%h 1 122!%%GhDhXt{{,CDa & 2f44 s   A<A>c                   N    \ rS rSrSrS rSrSrSrS r	S
S jr
     SS jrS	rg)RoleImpl   )rQ   namerJ   c                     [        5       eN)NotImplementedErrorselfr   rX   s      r   rG   RoleImpl._literal_coercion   s    !##r   NFc                 p    Xl         UR                  U l        [        U[        R
                  5      U l        g rp   )rQ   
_role_namern   r!   r   UsesInspectionrJ   )rs   
role_classs     r   __init__RoleImpl.__init__   s*    %))	)*e6J6JKr   c                 (    U R                  XU5        g rp   rN   rs   r   rZ   r8   rX   s        r   rU   RoleImpl._implicit_coercions  s      8<r   c                    Ub  X1La  U< SU< S3nO[        U5      nU(       a  U R                  < SU< SU< S3nOU R                  < SU< S3nU(       a  USU-   -  n[        R                  " [        R
                  " XS9US	9  g )
Nz object resolved from z objectz expected for argument z; got .z expected, got  )codereplace_context)reprrn   r   raise_r   ArgumentError)	rs   r   r8   rZ   advicer   errgotmsgs	            r   rN   RoleImpl._raise_for_expected  ss     H$;9A7KCw-C		C -1IIs;C3<CC%%c5sKr   )rQ   rJ   rn   rp   )NNNNN)__name__
__module____qualname____firstlineno__	__slots__rG   rT   rF   rH   ry   rU   rN   __static_attributes__r:   r   r   rl   rl      sA    :I$ N!+0(L
= Lr   rl   c                       \ rS rSrSrS rSrg)_Deannotatei%  r:   c                     SSK Jn  U" U5      $ )Nr   )_deep_deannotate)r   r   )rs   rZ   rX   r   s       r   rT   _Deannotate._post_coercion(  s    *))r   Nr   r   r   r   r   rT   r   r:   r   r   r   r   %  s    I*r   r   c                       \ rS rSrSrSrSrg)_StringOnlyi.  r:   TN)r   r   r   r   r   rF   r   r:   r   r   r   r   .  s    I r   r   c                   *    \ rS rSrSr SS jrS rSrg)_ReturnsStringKeyi4  r:   Nc                 j    [        U[        R                  5      (       a  U$ U R                  XU5        g rp   r   r   rb   rN   rs   r9   rZ   r8   rX   s        r   rU   %_ReturnsStringKey._implicit_coercions7  s/     &(9(9::##$$%5Ir   c                     U$ rp   r:   rr   s      r   rG   #_ReturnsStringKey._literal_coercion?      r   rp   r   r   r   r   r   rU   rG   r   r:   r   r   r   r   4      I 37Jr   r   c                   *    \ rS rSrSrS r SS jrSrg)_ColumnCoercionsiC  r:   c                 0    [         R                  " S5        g )Nz|implicitly coercing SELECT object to scalar subquery; please use the .scalar_subquery() method to produce a scalar subquery.)r   warn)rs   s    r   "_warn_for_scalar_subquery_coercion3_ColumnCoercions._warn_for_scalar_subquery_coercionF  s    			
r   Nc                    [        USS5      (       d  U R                  XU5        g UR                  (       a   U R                  5         UR	                  5       $ UR
                  (       aI  [        U[        R                  5      (       a*  U R                  5         UR                  R	                  5       $ U R                  R                  (       a  UR                  (       a  U$ U R                  XU5        g )Nr6   F)rI   rN   _is_select_statementr   scalar_subquery_is_from_clauser   
selectableSubqueryr   rQ   r;   _is_lambda_elementr   s        r   rU   $_ColumnCoercions._implicit_coercionsM  s     x!4e<<$$%5I**335++--%%*j))+
 +
 335##3355++0K0KO$$%5Ir   rp   )r   r   r   r   r   r   rU   r   r:   r   r   r   r   C  s    I
 37Jr   r   c           	          [         R                  " U" S[         R                  " U 5      U(       a  SU< 3OSU(       a  SU-  OSS.-  5      US9  g )Nzc%(extra)sTextual SQL expression %(expr)r %(argname)sshould be explicitly declared as text(%(expr)r)for argument  z%s )rf   r8   extrar   )r   r   ellipses_string)r   r8   exc_clsr   r   s        r   _no_text_coercionr   `  sQ     	KK4 ,,W5=D9"*/R	
 r   c                   "    \ rS rSrSrSS jrSrg)_NoTextCoercioniq  r:   Nc                     [        U[        R                  5      (       a5  [        [        R
                  U R                  5      (       a  [        X5        g U R                  X5        g rp   )	r   r   rb   r!   rA   
TextClauserQ   r   rN   rs   r   r8   rX   s       r   rG   !_NoTextCoercion._literal_coerciont  sJ    gt0011j!1!17
 7
 g/$$W6r   rp   r   r   r   r   r   rG   r   r:   r   r   r   r   q  s    I7r   r   c                   8    \ rS rSrSrSrSrSrSS jrSS jr	Sr
g)_CoerceLiteralsi}  r:   FNc                     [        X5      $ rp   r   rs   r   r8   s      r   _text_coercion_CoerceLiterals._text_coercion       22r   c                 .   [        U[        R                  5      (       a>  U R                  (       a  US:X  a  [        R                  SSS9$ U R                  " X40 UD6$ U R                  (       aI  Uc  [        R                  5       $ USL a  [        R                  5       $ USL a  [        R                  5       $ U R                  (       a<  [        U[        R                  5      (       a  [        R                  [        U5      SS9$ U R                  X5        g )N*T)
is_literalF)r   r   rb   _coerce_starrA   ColumnClauser   _coerce_constsNullFalse_True__coerce_numericsnumbersNumberr   rN   r   s       r   rG   !_CoerceLiterals._literal_coercion  s    gt0011  W^,,ST,BB**7BrBB}}&E!((D~~''  Z'..%J%J((W$(GG  2r   rp   )r   r   r   r   r   r   r   r   r   rG   r   r:   r   r   r   r   }  s!    INL33r   r   c                   .    \ rS rSrSr SS jrSS jrSrg)	LiteralValueImpli  TNc                 v    [        U5      (       d  U R                  " U4X#S.UD6  [        R                  S XSS9$ )N)rZ   r8   Ttype_unique)r   rN   rA   BindParameter)rs   r   rZ   r8   r   rX   s         r   rU   $LiteralValueImpl._implicit_coercions  sJ     8$$$$"*?A %%dG%NNr   c                     U$ rp   r:   )rs   r   r8   r   rX   s        r   rG   "LiteralValueImpl._literal_coercion  r   r   r:   rp   NN)r   r   r   r   rF   rU   rG   r   r:   r   r   r   r     s      15Or   r   c                   0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )_SelectIsNotFromi  r:   c                    > [        U[        R                  5      (       d  [        U[        R                  5      (       a  SUb  UR                  OU< S3nSnOS =pV[        [
        U ]  " U4UUUUS.UD6$ )NzTo create a FROM clause from a z$ object, use the .subquery() method.89ve)r8   rZ   r   r   )r   r   SelectStatementRolerR   superr   rN   )rs   r   r8   rZ   rX   r   r   rR   s          r   rN   $_SelectIsNotFrom._raise_for_expected  s    gu8899Ze//>
 >
 *2)=8%%7JM 
 D  F%t@

 
 	
r   r   r   r   r   r   r   rN   r   __classcell__rR   s   @r   r   r     s    I
 
r   r   c                   *    \ rS rSrSr SS jrS rSrg)HasCacheKeyImpli  r:   Nc                 j    [        U[        R                  5      (       a  U$ U R                  XU5        g rp   )r   
traversalsr	   rN   r   s        r   rU   #HasCacheKeyImpl._implicit_coercions  s/     &
(>(>??##$$%5Ir   c                     U$ rp   r:   rr   s      r   rG   !HasCacheKeyImpl._literal_coercion  r   r   rp   r   r:   r   r   r   r     r   r   r   c                   *    \ rS rSrSr SS jrS rSrg)ExecutableOptionImpli  r:   Nc                 V    [        U[        5      (       a  U$ U R                  XU5        g rp   )r   r   rN   r   s        r   rU   (ExecutableOptionImpl._implicit_coercions  s*     &(899##$$%5Ir   c                     U$ rp   r:   rr   s      r   rG   &ExecutableOptionImpl._literal_coercion  r   r   rp   r   r:   r   r   r   r     r   r   r   c                   <   ^  \ rS rSrSr SS jrSU 4S jjrSrU =r$ )ExpressionElementImpli  r:   c                     Uc/  U(       d(  Ub  UR                   (       d  [        R                  5       $  [        R                  X!USUS9$ ! [        R
                   a  nU R                  XS9   S nAg S nAff = f)NT)r   _is_crudr   )should_evaluate_nonerA   r   r   r   r   rN   )rs   r   rn   r   r8   is_crudrX   r   s           r   rG   'ExpressionElementImpl._literal_coercion  sv     Oe&@&@
 ==?";--5 .   $$ ;(((:;s   A
 
A7A22A7c                 |   > [        U[        R                  5      (       a  SnOS n[        [        U ]  " U4X#US.UD6$ )Nz`To create a column expression from a FROM clause row as a whole, use the .table_valued() method.r8   rZ   r   )r   r   AnonymizedFromClauseRoler   r   rN   rs   r   r8   rZ   rX   r   rR   s         r   rN   )ExpressionElementImpl._raise_for_expected  sQ    gu==>>>  F*DE
$
JL
 	
r   )NNNFr   )	r   r   r   r   r   rG   rN   r   r   r   s   @r   r   r     s    I EJ;(
 
r   r   c                   .    \ rS rSrSr SS jrSS jrSrg)BinaryElementImpli
  r:   Nc                      UR                  X1US9$ ! [        R                   a  nU R                  XS9   S nAg S nAff = f)N)r   r   )_bind_paramr   r   rN   )rs   r   rf   operatorbindparam_typer8   rX   r   s           r   rG   #BinaryElementImpl._literal_coercion  sD    	7##H^#LL   	7$$W$6	7s    ?:?c                     UR                   R                  (       a;  UR                   R                  (       d   UR                  Ub  UOUR                   5      nU$ rp   )r    _isnull_with_binary_element_type)rs   rZ   rf   r  rX   s        r   rT    BinaryElementImpl._post_coercion  s@    ==  ):):99"0"<$))H r   r   rp   )r   r   r   r   r   rG   rT   r   r:   r   r   r  r  
  s    I EI7r   r  c                   6    \ rS rSrSr SS jrS rS rS rSr	g)	InElementImpli  r:   Nc                 ~   UR                   (       a  [        U[        R                  5      (       aI  UR                  R
                  (       a.  U R                  U5        U R                  " UR                  40 UD6$ U R                  U5        U R                  " UR                  5       40 UD6$ U R                  XU5        g rp   )
r   r   r   Aliasr   r   _warn_for_implicit_coercionrT   selectrN   r   s        r   rU   !InElementImpl._implicit_coercions!  s     ##8Z%5%566$$9900:**8+;+;BrBB00:**8??+<CCC$$%5Ir   c                 ^    [         R                  " SUR                  R                  -  5        g )Nz_Coercing %s object into a select() for use in IN(); please pass a select() construct explicitly)r   r   rR   r   )rs   r"   s     r   r  )InElementImpl._warn_for_implicit_coercion1  s%    		:~~&&(	
r   c           	      L   [        U[        R                  5      (       a  [        U[        R                  5      (       d  0 n[        U5      nU Hh  n[        U5      (       d:  [        U[        R                  5      (       d  U R                  " U40 UD6  MG  XeU'   MM  Ub  MR  [        R                  5       XV'   Mj     U(       a<  [        R                  " U Vs/ s H  nXe;   a  XV   OUR                  X65      PM     sn6 $ UR                  X1SS9$ U R                  " U40 UD6  g s  snf )NT)	expanding)r   r   Iterabler   rb   r*   r   r   ColumnOperatorsrN   rA   r   
ClauseListr	  )rs   r   rf   r
  rX   non_literal_expressionsos          r   rG   InElementImpl._literal_coercion8  s   g7788T&&B
 B
 ')#7mG"1~~%a)B)BCC00?B?562Y19+.  '**
 ")	 ")A 7 02!--h:; ")	  ''T'JJ $$W33s   $D!c                 T   UR                   (       a  UR                  5       $ [        U[        R                  5      (       a*  [        UR                  5      S:X  a   eUR                  US9$ [        U[        R                  5      (       a  UR                  SS9nSUl
        X1l        U$ U$ )Nr   )againstT)maintain_key)r   r   r   rA   r  r-   clauses
self_groupr   _cloner  	expand_op)rs   r   rf   r
  rX   s        r   rT   InElementImpl._post_coercionV  s    '' **,,!4!4557??+q000%%h%77!7!788nn$n7G $G (NNr   rp   )
r   r   r   r   r   rU   r  rG   rT   r   r:   r   r   r  r    s!    I 37J 
4<r   r  c                   P   ^  \ rS rSrSrSr SU 4S jjrSU 4S jjrSS jrSr	U =r
$ )	OnClauseImplii  r:   Tc                 r   > U(       a  [        U[        5      (       a  U$ [        [        U ]  " UU4UUS.UD6$ )N)r8   legacy)r   r   r   r+  rU   )rs   r9   rZ   r8   r-  rX   rR   s         r   rU    OnClauseImpl._implicit_coercionsn  sJ     j3//Ot@   	
  r   c                    > U(       a-  [        U[        5      (       a  [        R                  " S5        U$ [        [
        U ]  X5      $ )NUsing strings to indicate relationship names in Query.join() is deprecated and will be removed in SQLAlchemy 2.0.  Please use the class-bound attribute directly.)r   r   r   r.   r   r+  r   )rs   r   r8   r-  rR   s       r   r   OnClauseImpl._text_coercion|  s>    j#..## N\47IIr   c                 H    [        U[        R                  5      (       a  U$ U$ rp   )r   r   JoinTargetRole)rs   rZ   r9   rX   s       r   rT   OnClauseImpl._post_coercion  s#     &(<(<==##r   NFrp   )r   r   r   r   r   r   rU   r   rT   r   r   r   s   @r   r+  r+  i  s)    IN @E
J r   r+  c                   &    \ rS rSrSrSrSS jrSrg)WhereHavingImpli  r:   TNc                     [        X5      $ rp   r   r   s      r   r   WhereHavingImpl._text_coercion  r   r   rp   r   r   r   r   r   r   r   r   r:   r   r   r7  r7    s    IN3r   r7  c                   &    \ rS rSrSrSrSS jrSrg)StatementOptionImpli  r:   TNc                 ,    [         R                  U5      $ rp   rA   r   r   s      r   r   "StatementOptionImpl._text_coercion  s    ""7++r   rp   r:  r:   r   r   r<  r<    s    IN,r   r<  c                       \ rS rSrSrSrg)ColumnArgumentImpli  r:   Nr   r   r   r   r   r   r:   r   r   rA  rA        Ir   rA  c                       \ rS rSrSrSrg)ColumnArgumentOrKeyImpli  r:   NrB  r:   r   r   rE  rE    rC  r   rE  c                   "    \ rS rSrSrSS jrSrg)StrAsPlainColumnImpli  r:   Nc                 ,    [         R                  U5      $ rp   )rA   r   r   s      r   r   #StrAsPlainColumnImpl._text_coercion  s    $$W--r   rp   )r   r   r   r   r   r   r   r:   r   r   rG  rG    s    I.r   rG  c                   &    \ rS rSrSrSrSS jrSrg)ByOfImpli  r:   TNc                 ,    [         R                  U5      $ rp   )rA   _textual_label_referencer   s      r   r   ByOfImpl._text_coercion  s    0099r   rp   r:  r:   r   r   rK  rK    s    IN:r   rK  c                       \ rS rSrSrS rSrg)OrderByImpli  r:   c                 ~    [        XR                  5      (       a"  UR                  b  [        R	                  U5      $ U$ rp   )r   rQ   _order_by_label_elementrA   _label_reference)rs   rZ   rX   s      r   rT   OrderByImpl._post_coercion  s5    x!1!12200<,,X66Or   Nr   r:   r   r   rP  rP    s    Ir   rP  c                   $    \ rS rSrSr SS jrSrg)GroupByImpli  r:   Nc                 ~    [        U[        R                  5      (       a  [        R                  " UR
                  6 $ U$ rp   )r   r   StrictFromClauseRolerA   r  cr   s        r   rU   GroupByImpl._implicit_coercions  s1     h : :;;&&

33Or   rp   r   r   r   r   r   rU   r   r:   r   r   rV  rV    s    I 37r   rV  c                   "    \ rS rSrSrSS jrSrg)DMLColumnImpli  r:   c                 ,    U(       a  UR                   $ U$ rp   )key)rs   r   r^   rX   s       r   rT   DMLColumnImpl._post_coercion  s    ;;Nr   NFr   r:   r   r   r]  r]    s    Ir   r]  c                   "    \ rS rSrSrSS jrSrg)ConstExprImpli  r:   Nc                     Uc  [         R                  5       $ USL a  [         R                  5       $ USL a  [         R                  5       $ U R	                  X5        g NFT)rA   r   r   r   rN   r   s       r   rG   ConstExprImpl._literal_coercion  sJ    ?==?"??$$_>>##$$W6r   rp   r   r:   r   r   rc  rc    s    I7r   rc  c                   .    \ rS rSrSr SS jrSS jrSrg)TruncatedLabelImpli  r:   Nc                 j    [        U[        R                  5      (       a  U$ U R                  XU5        g rp   r   r   s        r   rU   &TruncatedLabelImpl._implicit_coercions  s.     &(9(9::O$$%5Ir   c                 n    [        U[        R                  5      (       a  U$ [        R                  U5      $ )zcoerce the given value to :class:`._truncated_label`.

Existing :class:`._truncated_label` and
:class:`._anonymous_label` objects are passed
unchanged.
)r   rA   _truncated_labelr   s       r   rG   $TruncatedLabelImpl._literal_coercion  s-     gx8899N,,W55r   rp   r   r:   r   r   rh  rh    s    I 37J6r   rh  c                   &    \ rS rSrSrSrSS jrSrg)DDLExpressionImpli  r:   TNc                 ,    [         R                  U5      $ rp   r>  r   s      r   r    DDLExpressionImpl._text_coercion  s    
 ""7++r   rp   r:  r:   r   r   ro  ro    s    IN,r   ro  c                       \ rS rSrSrSrg)DDLConstraintColumnImpli  r:   NrB  r:   r   r   rs  rs    rC  r   rs  c                       \ rS rSrSrSrg)DDLReferredColumnImpli  r:   NrB  r:   r   r   ru  ru    rC  r   ru  c                   (    \ rS rSrSrSS jrS rSrg)LimitOffsetImpli  r:   Nc                 0    Uc  g U R                  XU5        g rp   r|   r}   s        r   rU   #LimitOffsetImpl._implicit_coercions!  s    $$Wx@r   c                 `    Uc  g [         R                  " U5      n[        R                  X%USS9$ )NTr   )r   asintr   _OffsetLimitParam)rs   r   rn   r   rX   values         r   rG   !LimitOffsetImpl._literal_coercion'  s7    ?JJw'E//5 0  r   rp   r   r:   r   r   rw  rw    s    IAr   rw  c                   2   ^  \ rS rSrSr SU 4S jjrSrU =r$ )LabeledColumnExprImpli1  r:   c                   > [        U[        R                  5      (       a  UR                  S 5      $ [        [
        U ]  " X4SU0UD6n[        U[        R                  5      (       a  UR                  S 5      $ U R                  XU5        g Nr8   )r   r   ExpressionElementRolelabelr   r  rU   rN   )rs   r9   rZ   r8   rX   newrR   s         r   rU   )LabeledColumnExprImpl._implicit_coercions4  s     h ; ;<<>>$''-tH 4;?AC #u::;;yy&(()9HMr   rp   )r   r   r   r   r   rU   r   r   r   s   @r   r  r  1  s    I 37N Nr   r  c                   h    \ rS rSrSrSrSrSr\R                  " S\R                  5      rSS jrSrg)ColumnsClauseImpliC  r:   Tz^\w\S*$Nc                     [        U5      nU R                  R                  U5      (       + n[        R                  " S[
        R                  " U5      U(       a  SU< 3OSU(       a  SOSS.-  5      e)NzTextual column expression %(column)r %(argname)sshould be explicitly declared with text(%(column)r), or use %(literal_column)s(%(column)r) for more specificityr   r   literal_columnra   )ra   r8   r  )r   _guess_straight_columnmatchr   r   r   r   )rs   r   r8   guess_is_literals       r   r    ColumnsClauseImpl._text_coercionL  sl    g,#::@@II#
 ..w7=D9"# #3	

 	
r   rp   )r   r   r   r   r   r   r   r   recompileIr  r   r   r:   r   r   r  r  C  s1    INLZZ
BDD9
r   r  c                       \ rS rSrSrSrg)ReturnsRowsImpli_  r:   NrB  r:   r   r   r  r  _  rC  r   r  c                   F   ^  \ rS rSrSrSS jr SU 4S jjrSS jrSrU =r	$ )StatementImplic  r:   c                     XLa.  [        U[        R                  5      (       d   UR                    U$ U$ ! [         a    [        R
                  " SU-  S5         U$ f = f)Na  Object %r should not be used directly in a SQL statement context, such as passing to methods such as session.execute().  This usage will be disallowed in a future release.  Please use Core select() / update() / delete() etc. with Session.execute() and other statement execution methods.1.4)r   r   rb   _execute_on_connectionrM   warn_deprecated)rs   rZ   r9   r8   rX   s        r   rT   StatementImpl._post_coercionf  sr    +Jd//5
 5

 77 x " 
$$ "22 	 
s   5 $AAc                 X   > UR                   (       a  U$ [        [        U ]  " X4SU0UD6$ r  )r   r   r  rU   )rs   r9   rZ   r8   rX   rR   s        r   rU   !StatementImpl._implicit_coercions|  s:     &&OA 4;?A r   c                 X    [         R                  " S5        [        R                  U5      $ )NzUsing plain strings to indicate SQL statements without using the text() construct is  deprecated and will be removed in version 2.0.  Ensure plain SQL statements are passed using the text() construct.)r   r.   rA   r   r   s      r   r   StatementImpl._text_coercion  s)    D	
 ""7++r   rp   )
r   r   r   r   r   rT   rU   r   r   r   r   s   @r   r  r  c  s!    I. 37, ,r   r  c                   $    \ rS rSrSr SS jrSrg)SelectStatementImpli  r:   Nc                 j    UR                   (       a  UR                  5       $ U R                  XU5        g rp   )_is_text_clausecolumnsrN   r   s        r   rU   'SelectStatementImpl._implicit_coercions  s-     ####%%$$%5Ir   rp   r[  r:   r   r   r  r    s    I 37Jr   r  c                       \ rS rSrSrSrg)
HasCTEImpli  r:   NrB  r:   r   r   r  r    rC  r   r  c                       \ rS rSrSrSrg)	IsCTEImpli  r:   NrB  r:   r   r   r  r    rC  r   r  c                   2    \ rS rSrSrSrSS jr SS jrSrg)	JoinTargetImpli  r:   Tc                 2    [        U[        5      (       a  U$ g rp   )r   r   )rs   r   r-  rX   s       r   rG    JoinTargetImpl._literal_coercion  s    gs##N $r   Nc                    [        U[        R                  5      (       a  U$ U(       a-  [        U[        5      (       a  [        R
                  " S5        U$ U(       a!  [        U[        R                  5      (       a  U$ U(       a(  UR                  (       a  [        R                  " SSS9  U$ U R                  XU5        g )Nr0  Implicit coercion of SELECT and textual SELECT constructs into FROM clauses is deprecated; please call .subquery() on any Core select or ORM Query object in order to produce a subquery object.r  version)
r   r   r3  r   r   r.   WhereHavingRoler   r  rN   )rs   r9   rZ   r8   r-  rX   s         r   rU   "JoinTargetImpl._implicit_coercions  s     &(<(<== $#
8S11## O
8U-B-BCCO55  6  O$$%5Ir   ra  r5  )	r   r   r   r   r   rH   rG   rU   r   r:   r   r   r  r    s    I+/(
 @E Jr   r  c                   2    \ rS rSrSr   SS jrSS jrSrg)FromClauseImpli  r:   Nc                     UR                   (       a@  U(       a  UR                  5       $ U(       a!  [        R                  " SSS9  UR                  $ g UR
                  (       a  U$ U R                  XU5        g Nr  r  r  )r   subqueryr   r  _implicit_subqueryr  rN   )rs   r9   rZ   r8   explicit_subqueryallow_selectrX   s          r   rU   "FromClauseImpl._implicit_coercions  sn     (( ((**$$: "  222  %%O$$%5Ir   c                 4    U(       a  UR                  5       $ U$ rp   )_deannotate)rs   r   
deannotaterX   s       r   rT   FromClauseImpl._post_coercion  s    &&((Nr   re  ra  )r   r   r   r   r   rU   rT   r   r:   r   r   r  r    s    I J4r   r  c                   &    \ rS rSrSr  SS jrSrg)StrictFromClauseImpli  r:   Nc                     UR                   (       a(  U(       a!  [        R                  " SSS9  UR                  $ U R	                  XU5        g r  )r   r   r  r  rN   )rs   r9   rZ   r8   r  rX   s         r   rU   (StrictFromClauseImpl._implicit_coercions  sF     ((\  #  ...$$%5Ir   r5  r[  r:   r   r   r  r    s    I Jr   r  c                   "    \ rS rSrSrSS jrSrg)AnonymizedFromClauseImpli  r:   Nc                 *    Ub   eUR                  US9$ )N)flat)_anonymous_fromclause)rs   r   r  rn   rX   s        r   rT   'AnonymizedFromClauseImpl._post_coercion  s     ||,,$,77r   )FNr   r:   r   r   r  r    s    I8r   r  c                       \ rS rSrSrS rSrg)DMLTableImpli  r:   c                 D    SUR                   ;   a  UR                   S   $ U$ )N	dml_table)_annotationsrr   s      r   rT   DMLTableImpl._post_coercion  s&    '...''44Nr   Nr   r:   r   r   r  r    s    Ir   r  c                   $    \ rS rSrSr SS jrSrg)DMLSelectImpli  r:   Nc                     UR                   (       aV  [        U[        R                  5      (       a'  UR                  R
                  (       a  UR                  $ UR                  5       $ U R                  XU5        g rp   )r   r   r   r  r   r   r  rN   r   s        r   rU   !DMLSelectImpl._implicit_coercions"  sY     ##8Z%5%566$$99'''(($$%5Ir   rp   r[  r:   r   r   r  r    s    I 37Jr   r  c                   0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )CompoundElementImpli1  r:   c                    > [        U[        R                  5      (       a  UR                  (       a  SnOSnOS n[        [
        U ]  " U4X#US.UD6$ )NzFUse the plain select() object without calling .subquery() or .alias().z9To SELECT from any FROM clause, use the .select() method.r  )r   r   FromClauseRole_is_subqueryr   r  rN   r  s         r   rN   'CompoundElementImpl._raise_for_expected4  se    gu3344##7  P  F($C
$
JL
 	
r   r   r   r   s   @r   r  r  1  s    I
 
r   r  RoleImpl)NNF)Ur   r  r   r   r   r   baser   r   r   r	   r
   r   r   r   r   rA   r=   r   r   sqltypesr   r   r(   r2   r\   r_   rj   objectrl   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r+  r7  r<  rA  rE  rG  ByOfRolerK  rP  rV  r]  rc  rh  ro  rs  ru  rw  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r@   dirrn   rI   clsendswithreplaceglobalsrY   r:   r   r   <module>r     sr    	    "  #     " 
	

#L
  m
`'
5",Lv ,L^*& *!& ! Jv J< 3#4#4Dd"	7f 	73f 3<x "
v 
4h 8 #
,h #
L-x (HH HV'?$4h 'T3o'7 3,/8 ,( / .?H .: 0(ENN :
(H 
	(H 	%x 7H 76h 62,_h ,k+<h 3 h &N1 N$
(/8 
8h *,OX *,Z	J/8 	J  )JX )JX!% !HJ> J083 8#_h JOX J$
/8 
*  JD
%
C}}V||FF+799T?3'D $L r   