+
    i                      ^ RI Ht ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 ^ R	IH
t
 ^ R
IHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIH t  ^RIH!t! ^RIH"t# ^RIH$t$ ^RIH%t% ^R IH&t& ^R!IHt ^R"I&H't' ^R#I&H(t( ^R$I&H)t) ^R!I&Ht* ^R%I&H+t+ ^R&I,H-t- ^R'I,H.t. ^R(I,H/t/ ^R)I,H0t0 ^R*I1H2t2 ^R+I1H3t3 ^R,I1H4t4 ^R-I1H5t5 ^R.I1H6t6 ^R/I1H7t7 ^R0I8H9t9 ^R1I:H;t; ^R2I:H<t< ^R3I=H>t> ^R4I=H?t? ^R5I=H@t@ ^R6I=HAtA ^R7I=HBtB ^R8I=HCtC ^R9I=HDtD ^R:I=HEtE ^R;IFHGtG ]'       ds   ^R<IHHItI ^R=IHHJtJ ^R>IHKtK ^R?ILHMtM ^R@INHOtO ^RAIPHQtQ ^RBIPHRtR ^RCISHTtT ^RDIUHVtV ^REI,HWtW ^RFIXHYtY ^RGI8HZtZ ^RHI:H[t[ ^RII=H\t\ ^RJI=H]t] ^RKI=H^t^ ^RLI=H_t_ ^RMI=H`t` ^RNIaHbtb ]! RO]RP7      tc]P                  te]P                  ! 4       tg]CP                  th ! RQ RR4      ti]P                  ! RSRT/4      tj ! RU RV]44      tk ! RW RX]k4      tl ! RY RZ]k4      tm ! R[ R\4      tn ! R] R^]n4      to ! R_ R`]n4      tp]&P(                  Ph                  P                  RaRb4       ! Rc Rd]m4      4       tr ! Re Rf];]6]E]-,          4      ts]&P(                  Ph                  P                  RaRg4       ! Rh Ri]l]>4      4       tt]&P(                  Ph                  P                  RaRj4       ! Rk Rl]m]D4      4       tuRRm Rn lltvRo Rp ltwRq Rr ltxRRs Rt llty ! Ru Rv4      tz ! Rw Rx]z4      t{ ! Ry Rz]z4      t| ! R{ R|]z4      t} ! R} R~]}4      t~ ! R R]}4      t ! R R]4      tR# )    )annotationsN)Any)cast)Dict)Iterable)List)Optional)Set)Tuple)Type)TYPE_CHECKING)TypeVar)Union)
attributes)
interfaces)loading)_is_aliased_class)ORMColumnDescription)ORMColumnsClauseRole)PathRegistry)_entity_corresponds_to)_ORMJoin)_TraceAdaptRole)AliasedClass)Bundle)
ORMAdapter)ORMStatementAdapter)exc)future)inspect)sql)util)	coercions)
expression)roles)visitors)_TP)is_dml)is_insert_update)is_select_base)_select_iterables)CacheableOptions)CompileState)
Executable)
Generative)Options)
UpdateBase)GroupedElement)
TextClause)CompoundSelectState)LABEL_STYLE_DISAMBIGUATE_ONLY)LABEL_STYLE_NONE)LABEL_STYLE_TABLENAME_PLUS_COL)Select)SelectLabelStyle)SelectState)TypedReturnsRows)InternalTraversal)_InternalEntityType)OrmExecuteOptionsParameter)PostLoad)Mapper)Query)_BindArguments)Session)Result)_CoreSingleExecuteParams)_ColumnsClauseArgument)SQLCompiler)_DMLTableElement)ColumnElement)_JoinTargetElement)_LabelConventionCallable)_SetupJoinsElement)ExecutableReturnsRows)
SelectBase)
TypeEngine_T)boundc                  l    ] tR t^ft$ RtR]R&   R]R&   R]R&    ! R R]4      tRR
 R lltR R lt	Rt
R	# )QueryContextcompile_staterunidpost_load_pathsintzDict[PathRegistry, PostLoad]ORMCompileStatec                  F    ] tR t^tRtRtRtRtRtRt	Rt
RtRtRtRtRtRtR# )!QueryContext.default_load_optionsFTN )__name__
__module____qualname____firstlineno___only_return_tuples_populate_existing_version_check_invoke_all_eagers
_autoflush_identity_token
_yield_per_refresh_state_lazy_loaded_from_legacy_uniquing_sa_top_level_orm_context_is_user_refresh__static_attributes__r[       C:\Users\petid\OneDrive\Desktop\Maestro\MAESTRO CLAUDE\MAESTRO\maestro-backend\venv\Lib\site-packages\sqlalchemy\orm\context.pydefault_load_optionsrZ      sE    #"!

  $(! rm   ro   Nc               8    V ^8  d   QhRRRRRRRRRR	R
RRRRR/# )   rT   r-   	statement2Union[Select[Any], FromStatement[Any], UpdateBase]user_passed_queryparamsrE   sessionrC   load_optionszQUnion[Type[QueryContext.default_load_options], QueryContext.default_load_options]execution_optionsz$Optional[OrmExecuteOptionsParameter]bind_argumentszOptional[_BindArguments]r[   )formats   "rn   __annotate__QueryContext.__annotate__   sf     @; @;#@; F@;
	@; )@; @;
@; @@;  1!@;rm   c	                	  a  VS n         T;'       g    \        S n        T;'       g    \        S n        VS n        VS n        VS n        VS n        R S n        R S n	        VS n
        VP                  S n        VP                  P                  p	VP                  p
\        ;QJ d     . V 3R l\!        W4       4       F  NK  	  5M! V 3R l\!        W4       4       4      S n        \%        VP&                  4      S n        VP(                  S n        VP,                  S n        VP0                  S n        VP4                  S n        VP8                  S n        VP<                  S n        VP@                  S n!        R# )Fc              3  t   <"   T F-  w  rVP                   '       g   K  VP                  SV4      x  K/  	  R # 5iN)propagate_to_loaders'_adapt_cached_option_to_uncached_option).0optuncached_optselfs   &  rn   	<genexpr>(QueryContext.__init__.<locals>.<genexpr>   s7      /
%J!'' LC77lKK%Js   88N)"rw   _EMPTY_DICTrx   ry   rT   queryrt   rv   loaders_require_bufferingloaders_require_uniquingru   rj   top_level_contextselect_statement_with_optionstuplezippropagated_loader_optionsdictr   rd   	autoflushra   populate_existingrc   invoke_all_eagersrb   version_checkrg   refresh_staterf   	yield_perre   identity_token)r   rT   rr   rt   ru   rv   rw   rx   ry   cached_optionsuncached_optionss   f&&&&&&&&  rn   __init__QueryContext.__init__   s<   $ )!2!A!Ak,;;*
 "3).&(-%!-!G!G&77EE,:: */ /
%(%J/
 /
%(%J/
 *
& }778%00!-!@!@!-!@!@)88)88%00*::rm   c                   V ^8  d   QhRR/# )rq   returnrS   r[   )rz   s   "rn   r{   r|      s     . . .rm   c                	.    V P                   ;'       g    T # r   )r   r   s   &rn   _get_top_level_context#QueryContext._get_top_level_context   s    %%---rm   )r   r   ry   rT   rx   r   r   rw   r   r   ru   r   r   r   r   rv   r   rt   r   r   )r   rT   r   rt   ru   rw   ry   rx   rv   r   r   r   r   r   create_eager_joinsr   r   rU   partialsrV   r   r   r   r   )NN)r\   r]   r^   r_   	__slots____annotations__r0   ro   r   r   rl   r[   rm   rn   rS   rS   f   s9    I6 J11""!w !@;D. .rm   rS    _result_disable_adapt_to_contextTc                  x   a  ] tR t^tRtR t]R V 3R ll4       t]R 4       t]R R l4       t	]R 4       t
R	tV ;t# )
AbstractORMCompileStateFc               	8   / V n         Vf   / V n        V'       g   Q hR # VP                  ;V n        pV'       dH   RVR&   V'       d9   VP                   F(  pVP                  '       g   K  VP                  V 4       K*  	  R # VP                  RR4      '       d   R # VP                  ^ ,          p VR,          pVP                   F<  pVP                  '       g   K  VP                  '       g   K+  VP                  V 4       K>  	  RVR&   R #   \         d     Li ; i)NTtoplevel_ormF
selectable)
r   global_attributes_global_attributesr   _is_criteria_optionprocess_compile_stategetstack_is_compile_stateKeyError)	r   rr   compilertoplevelprocess_criteria_for_toplevelgar   stack_0toplevel_stmts	   &&&$$    rn   _init_global_attributes/AbstractORMCompileState._init_global_attributes   s      &(D"O8*2*E*EED"R!%B~,$22C...11$7 3 VVNE**..#	4#L1M %22(((S-D-D-D--d3 3 ">  		s   /	D DDc               (    V ^8  d   QhRRRRRRRR/# )	rq   rr   r.   r   rG   kwr   r   r-   r[   )rz   s   "rn   r{   $AbstractORMCompileState.__annotate__
  s8     G GG G 	G
 
Grm   c                &   < \         SV `  ! W3/ VB # )a  Create a context for a statement given a :class:`.Compiler`.

This method is always invoked in the context of SQLCompiler.process().

For a Select object, this would be invoked from
SQLCompiler.visit_select(). For the special FromStatement object used
by Query to indicate "Query.from_statement()", this is called by
FromStatement._compiler_dispatch() that would be called by
SQLCompiler.process().
)supercreate_for_statement)clsrr   r   r   	__class__s   &&&,rn   r   ,AbstractORMCompileState.create_for_statement	  s    " w+IF2FFrm   c                	    \        4       hr   NotImplementedError)r   rv   rr   ru   rx   ry   is_pre_events   &&&&&&&rn   orm_pre_session_exec,AbstractORMCompileState.orm_pre_session_exec       "##rm   c                   V ^8  d   QhRR/# )rq   r   rD   r[   )rz   s   "rn   r{   r   )  s     
 
 

rm   c                	h    TP                  Y#;'       g    / VR 7      pV P                  VVVVVV4      # ))rx   )executeorm_setup_cursor_result)r   rv   rr   ru   rx   ry   connresults   &&&&&&& rn   orm_execute_statement-AbstractORMCompileState.orm_execute_statement(  sJ     ||7H  
 **
 	
rm   c                	    \        4       hr   r   r   rv   rr   ru   rx   ry   r   s   &&&&&&&rn   r   /AbstractORMCompileState.orm_setup_cursor_result>  r   rm   )r   r   )r\   r]   r^   r_   is_dml_returningr   classmethodr   r   r   r   rl   __classcell__r   s   @rn   r   r      sa    %"N G G$ 	$ 	$ 
 
* 	$ 	$rm   r   c                  :    ] tR tRtRt]R 4       t]R 4       tRtR# )AutoflushOnlyORMCompileStateiK  z>ORM compile state that is a passthrough, except for autoflush.c                	    \         P                  P                  R R0VVP                  4      w  ppV'       g#   VP                  '       d   VP	                  4        W$3# )_sa_orm_load_optionsr   )rS   ro   from_execution_options_execution_optionsrd   )r   rv   rr   ru   rx   ry   r   rw   s   &&&&&&& rn   r   1AutoflushOnlyORMCompileState.orm_pre_session_execN  sa     --DD" ((
	
  7 7 7 ++rm   c                	    V# r   r[   r   s   &&&&&&&rn   r   4AutoflushOnlyORMCompileState.orm_setup_cursor_resultk  s	     rm   r[   N)	r\   r]   r^   r_   __doc__r   r   r   rl   r[   rm   rn   r   r   K  s+    H, ,8 	 	rm   r   c                  v   ] tR tRt$  ! R R]4      t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&   ]tR]R&   Rt	R  t
]R! R" l4       t]R# R$ l4       tR% t]R& R' l4       t]R( 4       t]R) 4       t]R* 4       t]R+ 4       tR, tR- t]R. 4       tR/tR0# )1rX   ix  c                  d   ] tR tRtR]P
                  3R]P
                  3R]P
                  3R]P                  3R]P
                  3R]P
                  3R]P                  3R	]P
                  3R
]P
                  3R]P
                  3R]P
                  3.tRt	Rt
Rt]tRtRtRtRtRtRtRtRtR# )'ORMCompileState.default_compile_optionsiy  _use_legacy_query_style_for_statement_bake_ok_current_path_enable_single_crit_enable_eagerloads_only_load_props_set_base_alias_for_refresh_state_render_for_subquery_is_starFTNr[   )r\   r]   r^   r_   r<   
dp_booleandp_has_cache_keydp_plain_obj_cache_key_traversalr   r   r   _path_registryr   r   r   r   r   r   r   r   rl   r[   rm   rn   default_compile_optionsr   y  s    &(9(D(DE0;;<*556/@@A"$5$@$@A!#4#?#?@!2!?!?@ 1 < <=!#4#?#?@#%6%A%AB*556 
& #(
 &"!"$rm   r   zDict[Any, Any]r   r   rs   rr   r   List[_QueryEntity]	_entitiesz%Dict[_InternalEntityType, ORMAdapter]_polymorphic_adaptersz=Union[Type[default_compile_options], default_compile_options]compile_optionszOptional[_QueryEntity]_primary_entitybooluse_legacy_query_stylerK   _label_conventionzList[ColumnElement[Any]]primary_columnssecondary_columnszSet[ColumnElement[Any]]dedupe_columnszList[Tuple[Any, ...]]r   r   current_pathFc                	    \        4       hr   r   )r   argr   s   &*,rn   r   ORMCompileState.__init__      !##rm   c               (    V ^8  d   QhRRRRRRRR/# )	rq   rr   r.   r   rG   r   r   r   rX   r[   )rz   s   "rn   r{   ORMCompileState.__annotate__  s2     
 

 
 	

 

rm   c                	b    V P                   ! \        R V4      3RVP                  '       * RV/VB # )Union[Select, FromStatement]r   r   )_create_orm_contextr   r   )r   rr   r   r   s   &&&,rn   r   $ORMCompileState.create_for_statement  sE     &&/;
!'
 
 	
 	
rm   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )rq   rr   r  r   r   r   Optional[SQLCompiler]r   r   r   rX   r[   )rz   s   "rn   r{   r    s<     $ $/$ 	$
 ($ $ 
$rm   c               	    \        4       hr   r   )r   rr   r   r   r   s   &&$$,rn   r  #ORMCompileState._create_orm_context  s     "##rm   c                	r    V P                   pW9  d%   VP                  V4       VP                  V4       R # R # r   )r  addappend)r   objcol_collectiondedupes   &&& rn   _append_dedupe_col_collection-ORMCompileState._append_dedupe_col_collection  s1    $$JJsO!!#& rm   c               $    V ^8  d   QhRRRRRR/# )rq   label_styler9   legacyr   r   rK   r[   )rz   s   "rn   r{   r    s)     F F*F48F	!Frm   c                	L    V'       d   RR lpV# \         P                  ! V4      # )Nc                .    V'       d   V# \        V R 4      # )key)getattr)colcol_names   &&rn   name7ORMCompileState._column_naming_convention.<locals>.name  s    #O"3..rm   r   )r:   _column_naming_convention)r   r  r  r&  s   &&& rn   r(  )ORMCompileState._column_naming_convention  s$     / K88EErm   c                	    \        V4      # r   )_column_descriptionsr   rr   s   &&rn   get_column_descriptions'ORMCompileState.get_column_descriptions  s    #I..rm   c                	B   \         P                  P                  R 0 RmVVP                  4      w  ppRV9   d:   VR,          pVP                  P                  P                  VP                  V4      pV'       g   \        pMVP                  \        4      pVP                  '       d   VP                  RVP                  /4      p\        VP                  RR4      '       dN   \        VP                  P                  4      ^
8  d*   VP                  RR4      e   VP                  RRRR/4      pW%R	&    VP                  R
,          p	V	'       d   V	P                   VR&   T'       g#   TP$                  '       d   TP%                  4        Y$3#   \"         d	    Q R4       hi ; i)r   r   sa_top_level_orm_contextr   Ncompiled_cacheT_cache_disable_reasonz#excess depth for ORM loader optionsclauseplugin_subjectmapperz0statement had 'orm' plugin but no plugin_subject>   r   r   r   r   r0  )rS   ro   r   r   r   
merge_withrx   _orm_load_exec_optionsunionrf   r#  _compile_optionslenr   r   _propagate_attrsr5  r   rd   )
r   rv   rr   ru   rx   ry   r   rw   ctxr4  s
   &&&&&&&   rn   r   $ORMCompileState.orm_pre_session_exec  s    --DD" ((
	
( &)::#$>?C #		 < < G G%%'8! ! 6 1 7 78N O """ 1 7 7l556!
 I..FFI..<<=B!%%&6=I "''($/ 2-  $-x 	A&778HIN +9+@+@x( 7 7 7 ++  	MLLL5	Ms   4F Fc           
     	   VP                   pVP                  P                  pVP                  R \        P
                  4      p	VP                  P                  '       d   V# \	        VVVVVV	VV4      p
\        P                  ! Wj4      # )r   )
contextcompiledrT   r   rS   ro   r   r   r   	instances)r   rv   rr   ru   rx   ry   r   execution_contextrT   rw   querycontexts   &&&&&&&    rn   r   'ORMCompileState.orm_setup_cursor_resultE  s     #NN)22@@ ),,"L$E$E
 ((111M#	
   66rm   c                t    V P                    Uu. uF  p\        V\        4      '       g   K  VNK  	  up# u upi )zreturn all _MapperEntity objects in the lead entities collection.

Does **not** include entities that have been replaced by
with_entities(), with_only_columns()

)r   
isinstance_MapperEntity)r   ents   & rn   _lead_mapper_entities%ORMCompileState._lead_mapper_entitiesj  s4      >>
)CZ]-KCC>
 	
 
s   55c                ,   VP                   '       g   VP                  P                  V P                  9  d[   VP                  P	                  4        F:  pV P                  V\        \        P                  VVP                  VR7      4       K<  	  R# R# R# )a  given MapperEntity or ORMColumnEntity, setup polymorphic loading
if called for by the Mapper.

As of #8168 in 2.0.0rc1, polymorphic adapters, which greatly increase
the complexity of the query creation process, are not used at all
except in the quasi-legacy cases of with_polymorphic referring to an
alias and/or subquery. This would apply to concrete polymorphic
loading, and joined inheritance where a subquery is
passed to with_polymorphic (which is completely unnecessary in modern
use).

)equivalentsr   N)
is_aliased_classr5  persist_selectabler   iterate_to_root"_mapper_loads_polymorphically_withr   r   WITH_POLYMORPHIC_ADAPTER_equivalent_columns)r   ext_infor   mps   &&& rn    _create_with_polymorphic_adapter0ORMCompileState._create_with_polymorphic_adapterv  s     )))22--. oo55777'@@$&$:$:#-	 8. *rm   c                	    VP                   ;'       g    V. F@  pW P                  V&   VP                  4        F  pW P                  VP                  &   K  	  KB  	  R # r   )_with_polymorphic_mappersr   rO  local_table)r   r5  adapterm2ms   &&&  rn   rP  2ORMCompileState._mapper_loads_polymorphically_with  sR    22>>vh>B-4&&r*'')<C**1==9 * ?rm   c                	    \        R 4      h)z0this method only works for ORMSelectCompileStater   )r   r   r  s   &&&rn   _create_entities_collection+ORMCompileState._create_entities_collection  s    !>
 	
rm   r[   N)r\   r]   r^   r_   r,   r   r   r   r  _has_mapper_entitiesr   r   r   r  r  r(  r-  r   r   propertyrI  rU  rP  r_  rl   r[   rm   rn   rX   rX   x  s=   #"2 #J %%AAHH!!@@  ,+  //--//++  "0L,/ $ 
 
 $ $' F F / / W, W,r "7 "7H 	
 	
:D 
 
rm   rX   c                  0    ] tR tRtRtRtR tR tR tRt	R# )	_DMLReturningColFilteri  za base for an adapter used for the DML RETURNING cases

Has a subset of the interface used by
:class:`.ORMAdapter` and is used for :class:`._QueryEntity`
instances to set up their columns as used in RETURNING for a
DML statement.

c                	    Ve"   VP                   VP                   Jd   W n        MWn        \        P                  ! V P                  4      ;V n        V n        R # r   )rY  r5  r"   WeakPopulateDictadapt_check_presentcolumns)r   target_mapperimmediate_dml_mappers   &&&rn   r   _DMLReturningColFilter.__init__  sQ     ,))'334 /K (K&*&;&;$$'
 	
t|rm   c                	r    \         P                  ! V4       F  pV P                  V4      pVf   K  Vu # 	  R # r   )sql_util_find_columnsrg  )r   r$  	as_filterccc2s   &&&  rn   __call___DMLReturningColFilter.__call__  s6    ((-B))"-B~
 .
 rm   c                	    \        4       hr   r   )r   r$  s   &&rn   rg  *_DMLReturningColFilter.adapt_check_present  r
  rm   )rh  r5  N)r5  rh  __weakref__)
r\   r]   r^   r_   r   r   r   rr  rg  rl   r[   rm   rn   rd  rd    s     5I
$rm   rd  c                       ] tR tRtRtR tRtR# ) _DMLBulkInsertReturningColFilteri  aC  an adapter used for the DML RETURNING case specifically
for ORM bulk insert (or any hypothetical DML that is splitting out a class
hierarchy among multiple DML statements....ORM bulk insert is the only
example right now)

its main job is to limit the columns in a RETURNING to only a specific
mapped table in a hierarchy.

c                	    V P                   pVP                  P                  VR 4      pVf   R # VP                  P                  P                  V4      # r   )r5  _columntopropertyr   rY  ccorresponding_columnr   r$  r5  props   &&  rn   rg  4_DMLBulkInsertReturningColFilter.adapt_check_present  sH    ''++C6<!!##88==rm   r[   Nr\   r]   r^   r_   r   rg  rl   r[   rm   rn   rx  rx    s    >rm   rx  c                       ] tR tRtRtR tRtR# )"_DMLUpdateDeleteReturningColFilteri  aG  an adapter used for the DML RETURNING case specifically
for ORM enabled UPDATE/DELETE

its main job is to limit the columns in a RETURNING to include
only direct persisted columns from the immediate selectable, not
expressions like column_property(), or to also allow columns from other
mappers for the UPDATE..FROM use case.

c                	    V P                   pVP                  P                  VR 4      pVe&   VP                  P                  P                  V4      # V# r   )r5  rz  r   rN  r{  r|  r}  s   &&  rn   rg  6_DMLUpdateDeleteReturningColFilter.adapt_check_present  sO    ''++C6 ,,..CCCHH 
rm   r[   Nr  r[   rm   rn   r  r    s    
rm   r  ormorm_from_statementc                      ] tR tRt$ RtRtR]R&   R]R&   RtR]R	&   RtRt	Rt
Rt]t]t]R
 R l4       tR tR tR tRtR# )ORMFromStatementCompileStatei  NFFromStatementstatement_containerz)Union[SelectBase, TextClause, UpdateBase]requested_statementzOptional[_DMLTableElement]	dml_tablec          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )rq   rr   r  r   r   r   r  r   r   r   r  r[   )rz   s   "rn   r{   )ORMFromStatementCompileState.__annotate__  sC     C C/C 	C
 (C C 
&Crm   c               	@   Tp\        V\        4      '       g   Q hVe)   VP                  '       d   \        P                  ! R4      hV P                  V 4      pR Vn        VP                  P                  Vn	        V;Vn
        Vn        VP                  ;Vn        pVP                  '       d   VP                  Vn        RVn        . Vn        / Vn        VP                  Vn        VP                  '       dt   \        V\*        P,                  4      '       dT   VP.                  '       gB   VP                  '       g0   VP0                  \2        J d   VP5                  \6        4      Vn        MWn        TP;                  VP.                  '       g   VP                  '       g   VP0                  M\2        VP                  4      Vn        \>        PA                  VVPB                  VP$                  RR7       VP                  PD                  Vn#        VPI                  VVRRR7       VPJ                  '       d9   VPJ                   F(  pVPL                  '       g   K  VPO                  V4       K*  	  VPP                  '       d   VPP                   F  w  rV! V4       K  	  . Vn)        . Vn*        \W        4       Vn,        . Vn-        . Vn.        R Vn/        \        VP8                  \*        P`                  4      '       dt   / Vn1        VP$                   F  p
V
Pe                  V4       K  	  R;Vn3        Vn4        RVn5        VPR                   F!  pVPm                  VRVPn                  R7       K#  	  V# \q        \r        Pt                  VP8                  VPv                  R7      Vn<        V# )NzThe ORM FromStatement construct only supports being invoked as the topmost statement, as it is only intended to define how result rows should be returned.Tis_current_entitiesF)r   r   )within_columns_clauseadd_to_result_map)adapt_on_names)=rF  r  r   sa_excCompileError__new__r   r9  r   r  r  r   elementr  r(   tabler  r   r   r   r   r$   rN   _is_textual_label_styler6   set_label_styler7   rr   r(  r  _QueryEntityto_compile_state_raw_columnsr   r  r   r   r   r   _with_context_optionsr  r  setr  r   _fallback_from_clausesorder_byr3   extra_criteria_entitiessetup_compile_state_ordered_columns_textual_ordered_columns_loose_column_name_matchingprocess_add_to_result_mapr   r   ADAPT_FROM_STATEMENT_adapt_on_names_from_obj_alias)r   rr   r   r   r   r  r   r   fnr"  entityr{  s   &&$$,       rn   r  0ORMFromStatementCompileState._create_orm_context  s4    (-}====HNNN%%=  {{3#  00HH 	# <ON 4#8/B/J/JJ 9&__DN$(D!%'"2CC '''9j&;&;<<)))$$$&&*::&66.DN 'N!%!?!? !,,,Y5E5E5E &&%''"
 	%%,,NN $	 	& 	
 0@@NN$$*/	 	% 	
 ,,,*88(((--d3 9 444.DD4 E  "!#!e"$&(#dnnj&;&;<< ,.D(..**40 ) H%(I 48H0))  *.&.&A&A !  *,  $7442BB$D  rm   c                	    V# r   r[   )r   colscurrent_adapters   &&&rn   _adapt_col_list,ORMFromStatementCompileState._adapt_col_list      rm   c                	    R # r   r[   r   s   &rn   _get_current_adapter1ORMFromStatementCompileState._get_current_adapter  s    rm   c                   V P                   P                  P                  RR4      pV P                   P                  '       d   \	        W!4      pMFV P                   P
                  '       g   V P                   P                  '       d   \        W!4      pMRpV P                  P                  '       d1   \        V P                  4      ^8w  d   \        P                  ! R4      hV P                   F  pVP                  W4       K  	  R# )zoused by BulkORMInsert, Update, Delete to set up a handler
for RETURNING to return ORM objects and expressions

r4  NsCan't generate ORM query that includes multiple expressions at the same time as '*'; query for '*' alone if present)rr   r;  r   	is_insertrx  	is_update	is_deleter  r   r   r:  r   r  r  !setup_dml_returning_compile_state)r   
dml_mapperri  rZ  r  s   &&   rn   r  >ORMFromStatementCompileState.setup_dml_returning_compile_state  s    
 77;;d
 >>###6G ^^%%%)A)A)A8G G(((c$...AQ.F%%J 
 nnF44TC %rm   )r   r  r  r  r   r   r   r   r  r  r  r  r   r  r  r  r  r   rr   r  r  )r\   r]   r^   r_   r  ra  r   r  _has_orm_entitiesmulti_row_eager_loaderseager_adding_joinscompound_eager_adapterr   r  eager_joinsr   r  r  r  r  rl   r[   rm   rn   r  r    sl    O &&BB,0I)0#!)KC CJDrm   r  c                  p  a  ] tR tRt$ RtRt]P                  t]P                  t
RtR]R&   R]R&   R	]P                  3R]P                  3.]P"                  ,           t]R
]P&                  3.,           tRtRR R lltR t]R 4       tR tV 3R lt]R 4       t]R 4       t]R 4       t]R 4       tRt V ;t!# )r  i  a  Core construct that represents a load of ORM objects from various
:class:`.ReturnsRows` and other classes including:

:class:`.Select`, :class:`.TextClause`, :class:`.TextualSelect`,
:class:`.CompoundSelect`, :class`.Insert`, :class:`.Update`,
and in theory, :class:`.Delete`.

r  N(Union[ExecutableReturnsRows, TextClause]r  r   r  r  r9  Tc               $    V ^8  d   QhRRRRRR/# )rq   entitiesz%Iterable[_ColumnsClauseArgument[Any]]r  r  r  r   r[   )rz   s   "rn   r{   FromStatement.__annotate__  s(     / /7/ :/ 	/rm   c           
     	   \         P                  ! V4       Uu. uF+  p\        P                  ! \        P
                  VV R R7      NK-  	  upV n        W n        VP                  V n        VP                  V n	        VP                  V n
        VP                  V n        VP                  V n        \        V4      '       d   VP                  MRV n        W0n        R# u upi )T)apply_propagate_attrspost_inspectN)r"   to_listr#   expectr%   ColumnsClauseRoler  r  r(   	is_selectr  r  r  r*   r  r  )r   r  r  r  rH  s   &&&& rn   r   FromStatement.__init__  s     ||H-
 . ''&*!	 .
 nn ** ** ** **$27$;$;G   	  /%
s   1Cc                    V P                   ! W3/ VB pVP                  '       * pV'       d   W1n        VP                  ! VP                  3/ VB # )zprovide a fixed _compiler_dispatch method.

This is roughly similar to using the sqlalchemy.ext.compiler
``@compiles`` extension.

)_compile_state_factoryr   rT   r  rr   )r   r   r   rT   r   s   &&,  rn   _compiler_dispatch FromStatement._compiler_dispatch  sJ     33DIbI~~%%2" 7 7>2>>rm   c                n    \        \        \        P                  ! V 4      4      P                  pV! V 4      # )a  Return a :term:`plugin-enabled` 'column descriptions' structure
referring to the columns which are SELECTed by this statement.

See the section :ref:`queryguide_inspection` for an overview
of this feature.

.. seealso::

    :ref:`queryguide_inspection` - ORM background

)r   ORMSelectCompileStater:   get_plugin_classr-  )r   meths   & rn   column_descriptions!FromStatement.column_descriptions  s3     !;#?#?#E

!
! 	 Dzrm   c                	    V # r   r[   r   s   &rn   _ensure_disambiguated_names)FromStatement._ensure_disambiguated_names  r  rm   c              +  	   <"   \         P                  P                  R  V P                   4       4       Rj  xL
  \        SV `  ! R/ VB  Rj  xL
  R#  L L5i)c              3  8   "   T F  qP                   x  K  	  R # 5ir   )_from_objectsr   r  s   & rn   r   -FromStatement.get_children.<locals>.<genexpr>  s      1
1Bg!!1B   Nr[   )	itertoolschainfrom_iterabler  r   get_children)r   r   r   s   &,rn   r  FromStatement.get_children  sW     ??00 1
151B1B1
 
 	
 	
 7'-"---	
 	.s!   4AAAAAAc                	.    V P                   P                  # r   )r  _all_selected_columnsr   s   &rn   r  #FromStatement._all_selected_columns  s    ||111rm   c                	h    \        V P                  4      '       d   V P                  P                  # R # r   )r(   r  _return_defaultsr   s   &rn   r  FromStatement._return_defaults  s%    06t||0D0Dt||,,N$Nrm   c                	h    \        V P                  4      '       d   V P                  P                  # R # r   )r(   r  
_returningr   s   &rn   r  FromStatement._returning  s%    *0*>*>t||&&HDHrm   c                	h    \        V P                  4      '       d   V P                  P                  # R # r   )r)   r  _inliner   s   &rn   r  FromStatement._inline!  s%    '7'E'Et||##O4Orm   )	r  r  r  r  r  r(   r  r  r  T)"r\   r]   r^   r_   r   __visit_name__r  r   r9  r   r  _for_update_argr   r<   dp_clauseelement_listdp_clauseelementr.   _executable_traverse_internals_traverse_internalsr   r   is_from_statementr   r  rb  r  r  r  r  r  r  r  rl   r   r   s   @rn   r  r    s    *N3KK9NNO55 
*@@A	%667 	112
 /	.??@2  /4?"  ". 2 2 O O I I P Prm   r  compound_selectc                      ] tR tRtRtR# )CompoundSelectCompileStatei&  r[   N)r\   r]   r^   r_   rl   r[   rm   rn   r  r  &  s     	rm   r  selectc                  T   ] tR tRtR$t]tRtRtRt	Rt
RtRtRtRtR$tR$t]R R l4       tR tR t]R 4       t]R	 4       t]R
 4       t]R 4       t]R 4       tR tR tR tR tR tR%R ltR t R t!R t"R t#R t$R t%R t&R t'R t(R t)R t*R t+],R 4       t-],R  4       t.R! t/R" t0R#t1R# )&r  i-  NFc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )rq   rr   r  r   r   r   r  r   r   r   r  r[   )rz   s   "rn   r{   "ORMSelectCompileState.__annotate__A  sC     ` `/` 	`
 (` ` 
`rm   c               	T   V P                  V 4      pTpV P                  P                  VP                  4      Vn        VP                  '       d;   VP                  4       Vn        \        P                  ! 4       VP                  n        MWen        VP                  P                  Vn
        VP                  P                  Vn        . Vn        R Vn        / Vn        VP                  Vn        V'       g   V;P                   RRRR/,          un        VP                  '       dI   VP                  P"                  \$        J d+   VP                  '       g   \&        Vn        M'\*        Vn        MVP                  P"                  Vn        VP,                  '       dD   VP,                   Uu/ uF'  pV\.        P1                  VVP2                  . RR7      bK)  	  upVn        VP7                  VP"                  VP                  4      Vn        \.        P1                  VVP2                  VP                  RR7       VP                  P:                  Vn        RVn        VPA                  VVVRR7       V'       d   VPB                  '       g   VP,                  '       d   VP,                   Fu  pVPB                   Fb  pVPD                  '       g   K  TPG                  TVP4                  V,           U	u. uF  p	\I        V	\J        4      '       g   K  V	NK  	  up	4       Kd  	  Kw  	  VP                  PB                   F(  pVPD                  '       g   K  VPM                  V4       K*  	  VPN                  '       d   VPN                   F  w  rV
! V4       K  	  . Vn(        . Vn)        \U        4       Vn+        / Vn,        / Vn-        . Vn.        . Vn/        VPa                  R VPb                   4       4      Vn2        VPg                  4        \h        Pj                  ! WUPl                  V3/ VB  V# u upi u up	i )	Nr   Fr   Tr  )r   r   c              3  8   "   T F  qP                   x  K  	  R # 5ir   )r   )r   infos   & rn   r   <ORMSelectCompileState._create_orm_context.<locals>.<genexpr>  s      2
(BOO(Br  r[   )7r  r   
safe_merger9  r   _cloner   r"   immutabledictr   for_statementr   r  r   r   r   r   r  LABEL_STYLE_LEGACY_ORMr7   r  r5   _memoized_select_entitiesr  r  r  _memoized_entitiesr(  r  r   r  eager_order_byr   r   r   'process_compile_state_replaced_entitiesrF  rG  r   r  r  r  r  r  r  r  r   r  _normalize_froms	_from_objfrom_clauses_setup_for_generater:   r   rr   )r   rr   r   r   r   r   r   memoized_entitiesr   rH  r  r"  s   &&$$,       rn   r  )ORMSelectCompileState._create_orm_context@  s    {{3$ &)%@%@%K%K&&&
	" ... %5$;$;$=D!7;7I7I7KD!!4$4! .>>MM --EE 	# #%'"/@@   $e&%   '''%%226LL%%%#A #@ #44AAD555 %>>
' ? & "<#@#@%22(-	 $A $  ?
'D#  "&!?!?""D$?$?"
 	%%))NN $	 	& 	
 -==KK $$*/	 	% 	
 ***999 ";; ",::C,,,CC  ,0+B+B$5,","C $.c=#A	 !$,"	 ; < ,,::(((--d3 ; 111+AA4 B  "!#!e')$"$&(# !11 2
(8(B(B2
 
 	  "T>>8BrB}
'bs   &-P )P%P%c                	   \        R 4       \        RV P                   24       V P                   EF  p\        V\        4      '       d   V^ ,          R8X  dt   \        R\
        P                  ! V^,          4       24       \        RV P                  V,           24       \        RV P                  V,          P                   24       K  \        V\        4      '       g   K  V^ ,          R8X  g   K  \        R\
        P                  ! V^,          4       24       \        RV P                  V,           24       EK  	  R# )z5
---------------------------------------------------
zcurrent path: loaderz
Loader:           z    path_with_polymorphicz
With Polymorphic: N)printr  r   rF  r   r   coerce__dict__)r   r"  s   & rn   _dump_option_struct)ORMSelectCompileState._dump_option_struct  s    GHt00123??C#u%%#a&H*<,\-@-@Q-H,IJKT__S1234T__S1::;<=C''CF6M,M,\-@-@Q-H,IJKT__S1234 #rm   c                	p  a V P                   pR V n        RV n        V P                  P                  '       d   V P                  4        VP                   FD  pVP                  '       g   K  V P                  VP                  V P                  V,          4       KF  	  VP                  '       d'   V P                  VP                  V P                  4       V P                  4       oVP                  '       de   VP                  V n        S'       dL   \        ;QJ d!    . V3R lV P                   4       F  NK  	  5M! V3R lV P                   4       4      V n        S'       d.   VP                  R9  d   V P                  VP                  S4      MVP                  V n        VP"                  '       dL   \        ;QJ d!    . V3R lVP"                   4       F  NK  	  5M! V3R lVP"                   4       4      V n        S'       dB   VP$                  R9  d1   V P                  \&        P(                  ! VP$                  4      S4      MVP$                  ;'       g    R V n        V P,                  '       d>   V P.                  ^ ,          P0                  pVP3                  V P,                  4      V n        VP4                  '       d#   V P                  VP4                  S4      V n        MRV n        VP8                  V n        VP<                  '       d7   \        \&        P(                  ! R VP<                   4       4      4      V n        M]VP@                  e7   \        \&        P(                  ! R VP@                   4       4      4      V n!        MVPD                  '       g   RV n        VPF                  V n#        V P                  PH                  '       d1   \K        V P                  4      ^8w  d   \L        PN                  ! R4      hV P                   F  pVPQ                  V 4       K  	  V PR                   F  pV^ ,          pV! V .VR,          O5!   K  	  V P                  PT                  '       d   V PW                  4        V PX                  '       g:   V P                  PZ                  '       d   Q R4       h\L        P\                  ! R	4      hV P.                  '       g   \_        V P`                  4      V n        V P                   RJ d   R V n        V Pb                  '       d;   V Pd                  '       d)   V Pf                  '       d   V Pi                  4       V n        MV Pk                  4       V n        V Pl                  '       d;   V Po                  4       pVe%   V P                  Pq                  R
V/4      V n        R # R # R # )Nc              3  6   <"   T F  pS! VR 4      x  K  	  R# 5iTNr[   r   critr  s   & rn   r   <ORMSelectCompileState._setup_for_generate.<locals>.<genexpr>	  s"      - 4 $D$// 4s   Fc              3  J   <"   T F  pS'       d
   S! VR 4      MTx  K  	  R# 5ir$  r[   r%  s   & rn   r   r'    s&      *2D 0?d+DH2s   ##c              3  Z   "   T F!  pVe   \         P                  ! V4      MR x  K#  	  R # 5ir   rm  surface_selectablesr   ss   & rn   r   r'  7  s+      &- 89}H003$N-   )+c              3  Z   "   T F!  pVe   \         P                  ! V4      MR x  K#  	  R # 5ir   r*  r,  s   & rn   r   r'  >  s+      &4 89}H003$N4r.  r  :   NNz,no columns were included in _only_load_propsz4Query contains no columns with which to SELECT from.
deepentityr[   NFr   )9r   rr   _join_entitiesr   r   _set_select_from_aliasr  _setup_joins_joinr  r   r  _where_criteriar   _order_by_clausesr  r  _having_criteria_group_by_clausesr"   flatten_iteratorgroup_byr  r  _target_adaptercopy_and_process_distinct_ondistinct_on	_distinctdistinct
_correlate	correlate_correlate_exceptcorrelate_except_auto_correlater  r   r:  r  r  r  r   r   _adjust_for_extra_criteriar  r   InvalidRequestErrorlistr  r  r  _should_nest_selectable_compound_eager_statement_simple_statementr  _mapper_zero	_annotate)	r   r   r  rZ  r  recstrategyezeror  s	   &       @rn   r  )ORMSelectCompileState._setup_for_generate  s   %% ///'')!&!@!@ ---

%22++,=> "A JJu))4>>:335   #(#8#8D ',u - $ 4 4-uu - $ 4 4- ($ 5#:#:-#O   !8!8/J(( 	 !!!$)E *!22*EE *!22* %D! 5#:#:-#O   %%e&=&=> ((00D 	 ''*::G")":":4;N;N"OD#33""O D  "D #%% &"--& DN $$0$)%% &"44& %D! &&&$DN  %44(((c$...AQ.F%%J  nnF&&t, % **C1vHT$CG$ + 333++-#####444LLLu,,F      $T%@%@ AD==E! DM (((''',,,!;;=DN!335DN%%'E  "&!9!9!5)" ! rm   c                    V P                  V 4      p. Vn        RVn        / Vn        VP	                  VP
                  V4      Vn        \        P                  W1P                  VP                  RR7       V# )zCreates a partial ORMSelectCompileState that includes
the full collection of _MapperEntity and other _QueryEntity objects.

Supports a few remaining use cases that are pre-compilation
but still need to gather some of the column  / adaption information.

NTr  )
r  r   r   r   r(  r  r  r  r  r  )r   r   r  r   s   &&& rn   r_  1ORMSelectCompileState._create_entities_collection|  st     {{3#%'"!%!?!?"
 	%%$$dnn$ 	& 	
 rm   c                	2    VP                   p\        VR 4      # r   )r5  _determine_last_joined_entity)r   rr   setup_joinss   && rn   determine_last_joined_entity2ORMSelectCompileState.determine_last_joined_entity  s    ,,,[$??rm   c              #  	  "   VP                    F  pVP                  '       d~   R VP                  9   dm   VP                  R ,          pVP                  '       g)   VP                  '       g   \        V.4       Rj  xL
  Ks  \        VP                  4       Rj  xL
  K  \        V.4       Rj  xL
  K  	  R#  L? L" L5i)entity_namespaceN)r  is_selectable_annotations	is_mapperrM  r+   _all_column_expressions)r   rr   r  enss   &&  rn   all_selected_columns*ORMSelectCompileState.all_selected_columns  s      --G%%%&'*>*>>**+=>}}}S-A-A-A0';;;01L1LMMM,gY777 . <M7sB   ACC,C;B;<CB=C0B?1C=C?Cc                	    V P                  \        P                  P                  R  VP                   4       4      4      # )c              3     "   T FD  pR VP                   9  d   VP                  M!VP                   R ,          P                  4       .x  KF  	  R# 5i)parententityN)r^  r  __clause_element__r  s   & rn   r   AORMSelectCompileState.get_columns_clause_froms.<locals>.<genexpr>  sW      *  6G &W-A-AA ))  ,,*,,.  6s   AA)r  r  r  r  r  r,  s   &&rn   get_columns_clause_froms.ORMSelectCompileState.get_columns_clause_froms  s<    ##OO)) *  )55* 
 	
rm   c                	   \         P                  ! \        P                  VVR 7      p\	        VP
                  V4      pVP                  P                  VP                  VP                  VP                  VP                  R7       V# ))r  )r   r  r   r;  )r#   r  r%   ReturnsRowsRoler  r  r  updater   r  r   r;  )r   rr   from_statementstmts   &&& rn   rn  $ORMSelectCompileState.from_statement  sw    "))!!"+
 Y33^D#11"+"A"A(;;&77	 	 	
 rm   c                ,   V P                   pV P                  P                  '       g   Q h\        VP                  4      ^8X  g   Q hV P                  VP                  ^ ,          4      pV'       d$   V ;P                  RR/,          un        W n        R# R# ) used only for legacy Query casesr   FN)r   r   r   r:  r  _get_select_from_alias_from_objr  )r   r   rZ  s   &  rn   r4  ,ORMSelectCompileState._set_select_from_alias  s|     %%##333335??#q(((66uq7IJ  %:E$BB #*  rm   c                   TpRVP                   9   d   VP                   R,          p\        VR4      '       d5   VP                  '       g   \        P                  ! R4      hVP
                  # \        VP                  \        P                  P                  4      '       dH   V P                  4       pW"P                  J g   Q h\        \        P                  VP                  VR7      # R# )rr  rf  r5  zPA selectable (FromClause) instance is expected when the base alias is being set.rL  N)r^  hasattrrM  r  ArgumentError_adapterrF  r   r!   AliasedReturnsRows_all_equivsr   r   LEGACY_SELECT_FROM_ALIAS)r   from_objr	  equivss   &&  rn   rs  5ORMSelectCompileState._get_select_from_alias_from_obj  s     T...$$^4D4""(((**A 
 }}$)J)JKK%%'F??***&88"  rm   c                <    V P                   ^ ,          P                  # )z8return the Mapper associated with the first QueryEntity.)r   r5  r   s   &rn   rN  "ORMSelectCompileState._mapper_zero  s    ~~a '''rm   c                    V P                    F)  pRVP                  9   g   K  VP                  R,          u # 	  V P                   F#  pVP                  '       g   K  VP                  u # 	  R# )zReturn the 'entity' (mapper or AliasedClass) associated
with the first QueryEntity, or alternatively the 'select from'
entity if specified.rf  N)r  r^  r   entity_zero)r   rH  qents   &  rn   _entity_zero"ORMSelectCompileState._entity_zero  s`    
 $$C!1!11''77 % NND''' # rm   c                	    V P                   V P                  .8w  d   \        P                  ! R V,          4      hV P                  P                  # )z4%s() can only be used against a single mapped class.)r   r   r  rI  r  )r   methnames   &&rn   _only_full_mapper_zero,ORMSelectCompileState._only_full_mapper_zero	  sK    >>d2233,,)+34  ##///rm   c                	    \        V P                  4      ^8  d!   \        P                  ! T;'       g    R4      hV P	                  4       # )r0  z8This operation requires a Query against a single mapper.)r:  r   r  rI  r  )r   	rationales   &&rn   _only_entity_zero'ORMSelectCompileState._only_entity_zero  sI    t~~",, + ++ 
   ""rm   c                	   / pV P                   P                  4        FY  pV Uu. uF  p\        V\        4      '       g   K  VNK  	  up F(  pVP	                  VP
                  P                  4       K*  	  K[  	  V P                   Uu. uF  p\        V\        4      '       g   K  VNK  	  up F(  pVP	                  VP
                  P                  4       K*  	  V# u upi u upi r   )r  valuesrF  rG  rm  r5  rR  r   )r   r~  r  rH  s   &   rn   r{  !ORMSelectCompileState._all_equivs  s    !%!8!8!?!?!A -,Cc=1 ,
 cjj<<= "B  >>
)CZ]-KCC>
C MM#**889
 
s   CCC!%C!c                	   V P                   '       dt   V P                    Uu. uF;  p\        V\        P                  P                  4      '       d   VP
                  MTNK=  	  pp\        P                  ! V P                  V4      pM. pR pV P                  ! V P                  V Uu. uF  qDV P                  9  g   K  VNK  	  up,           V P                  V P                  V P                  V P                  V P                   3RV P                  RV P                   P"                  RV P                   P$                  RV P&                  RV P(                  /V P*                  B pVP-                  4       pV P/                  4       p\1        \2        P4                  WVR7      V n        \8        P:                  ! V.V P<                  ,           !  pV P                  Vn        V P                  e*   V P                  P@                  f   V P                  Vn        TpV PB                  PE                  4        F$  p	\        PF                  ! WV	PH                  4      pK&  	  VPJ                  PM                  Wx4       V'       d8   VP                   PL                  ! V.V P6                  PO                  V4      O5!   VP                   PL                  ! V.V PP                  O5!   V# u upi u upi )N
for_updatehintsstatement_hintsrD  rF  rv  ))r  rF  r!   elements_label_referencer  rm   expand_column_list_from_order_byr  _select_statementr  r  r7  r9  r  r  r   _hints_statement_hintsrD  rF  _select_argsaliasr{  r   r   COMPOUND_EAGER_STATEMENTr  r   r  r  r  ofr  r  splice_joinsstop_onselect_fromnon_generativer>  r  )
r   elemunwrapped_order_byorder_by_col_exprr{  innerr~  rr   from_clause
eager_joins
   &         rn   rL  /ORMSelectCompileState._compound_eager_statement+  s   
 === !MM" *D "$(E(EFF LL *  " !) I I$$&8! !#!% &&  +L+Q8K8K/Kqq+LM  !!MM
 ++
 ''..
 !11BB
 nn
 "22
 
  !!#&944e'
# MMg...
	 "&!1!1	   ,$$''/(,(<(<I%**113J #//););K	 4 	,,YD--,,==& 	)))Jd6I6IJ["( Ms   AK%K
<K
c                	Z   V P                   ! V P                  V P                  ,           \        V P                  4      \        V P
                  P                  4       4      ,           V P                  V P                  V P                  V P                  3R V P                  RV P                  P                  RV P                  P                  RV P                  RV P                   /V P"                  B pV P$                  '       d)   VP                  P&                  ! V.V P$                  O5!   V# )r  r  r  rD  rF  )r  r  r  r   r  r  r  r7  r9  r  r  r  r   r  r  rD  rF  r  r  r  )r   rr   s   & rn   rM  'ORMSelectCompileState._simple_statement  s   **  4#9#99$##$uT-=-=-D-D-F'GG  !!MM
 ++
 ''..
 !11BB
 nn
 "22
 
	 --iN$:M:MNrm   c                	   \         P                  ! VVVR 7      pV'       d   VVn        V'       d   VVn        V'       d#   V;P                  \        V4      ,          un        V'       d    VP                  P                  ! V.VO5!   M#V'       d   VP                  P                  V4       V'       d#   V;P                  \        V4      ,          un        VVn	        VVn
        VVn        VVn        VVn        VVn        V'       d   VVn        V'       d   VVn        VVn        V'       d   VVn        V	'       d   V	Vn        V
'       d   VP(                  P                  ! V.V
O5!   Ve   VP*                  P                  ! V.VO5!   V# ))r  r  r  )r8   _create_raw_selectr7  r9  r8  r   rB  r  r:  _limit_clause_offset_clause_fetch_clause_fetch_clause_options_independent_ctes_independent_ctes_opts	_prefixes	_suffixesr  r  r  rD  rF  )r   raw_columnsr}  where_criteriahaving_criteriar  r  r  r  r  rD  rF  limit_clauseoffset_clausefetch_clausefetch_clause_optionsrB  r@  prefixessuffixesr<  independent_ctesindependent_ctes_optsrr   s   &&&&&&&&&&&&&&&&&&&&&&& rn   r  'ORMSelectCompileState._select_statement  sE   2 --$$
	 (6I%)8I&''5?:'--iF+F--i8''5?:'".	#0	 ".	*>	'&6	#+@	("*I"*I$.	!$I)8I&..yE9E'&&55, rm   c                	   R VP                   9   dI   VP                   R ,          pV P                  P                  VR4      pV'       d   VP                  V4      # \	        V\
        P                  4      '       d   TpM!\        VR4      '       d   VP                  pMR# V P                  P                  VR4      pV'       d   VP                  V4      # R# )rf  Nr  )	r^  r   r   adapt_clauserF  r$   
FromClauserw  r  )r   r  searchr  s   &&  rn   _adapt_polymorphic_element0ORMSelectCompileState._adapt_polymorphic_element  s    W111)).9F..2264@E))'22gz4455FWg&&]]F**..vt<%%g.. rm   c                	P    V'       d   V Uu. uF  q2! VR 4      NK  	  up# V# u upi r  r[   )r   r  r  os   &&& rn   r  %ORMSelectCompileState._adapt_col_list  s+    6:;dOAt,d;;K <s   #c                	   a . oV P                   '       d(   SP                  R V P                   P                  34       V P                  '       d   SP                  RV P                  34       S'       g   R# V3R lpV# )TFNc                @   < V3R  lp\         P                  ! V / V4      # )c                   < R V P                   9   ;'       g    RV P                   9   pS F'  w  r#V'       g   V'       g   K  V! V 4      pVf   K%  Vu # 	  R# )
_orm_adaptrf  N)r^  )r  is_orm_adaptalways_adaptrZ  eadapterss   &    rn   replaceRORMSelectCompileState._get_current_adapter.<locals>._adapt_clause.<locals>.replace   sW     D$5$55 ; ;%):)::  .6)L#||#DM=#$H	 .6rm   )r&   replacement_traverse)r3  ro  r  r  s   && rn   _adapt_clauseAORMSelectCompileState._get_current_adapter.<locals>._adapt_clause  s    	% 00WEErm   )r  r  r  r   r  )r   r  r  s   & @rn   r  *ORMSelectCompileState._get_current_adapter  sr     OO((00 %%%OOUD$C$CDE	F" rm   c           
     	   V EF  w  r4rVVR ,          pVR,          p\        V4      pVe   \        V4      p\        V\        P                  4      '       d    Ve   \        P
                  ! R4      hTpRpM$RVP                  9   d   VP                  R,          pVf;   VP                  '       g)   \        VR4      '       g   \        P                  ! R4      h\        V\        P                  4      '       d   \        VRR4      p	Vf%   V	'       d   T	pMVP                  p VP                  pVP                  pVP                  p\        V\        P                   4      '       g   TpWVP"                  3V P$                  9   d   EK  Ve^   W[JdY   VP                  P'                  RR4      VJd9   \        P
                  ! R	VP                  P'                  RV4      : R
V: 24      hMVe   RpTpMR;rV P)                  VVVVVVV4       EK  	  R#   \         d$   p
\        P                  ! RT,          4      T
hRp
?
ii ; i)isouterfullNzUNo 'on clause' argument may be passed when joining to a relationship path as a targetrf  r5  z9Expected mapped entity or selectable/table as join target_of_typez0Join target %s does not refer to a mapped entityzexplicit from clause z4 does not match left side of relationship attribute )r    rF  r   PropComparatorr  rI  r^  r]  rw  rx  r#  rb  r  AttributeError_parententityr   QueryableAttributer"  _already_joined_edgesr   _join_left_to_right)r   argsentities_collectionrightonclausefrom_flagsr  r  of_typeerrleftr~  s   &&&          rn   r6  ORMSelectCompileState._join/  s?   -1)EUI&G=DENE#"8,%!:!:;;' 44= 
 !5#5#55**>:***75(3K3K ..: 
 (J$=$=>> "(J== ' ( 1 1'$)LLE  --((!(J,I,IJJ#H *d.H.HH$)!..22>4H#$ %88 !& 2 2 6 6~u M (	  " #" $$#e .2R  . '"("6"6!027!8# $'''s    HI H;;I c           
        Vf   Ve   Q hV P                  WW44      w  ppp	MV P                  W4      w  pp	W#J d    \        P                  ! RV: RV: R24      hV P	                  W#WE4      w  rpV
P
                  '       g   V P                  V
4      pMRpVe\   V P                  V,          pV P                  RV \        VVVVVVR7      .,           V P                  V^,           R ,           V n        R# V	e2   \        W,          \        4      '       g   Q hW,          P                  pMTpV P                  \        VV
VVVVR7      .,           V n        R# )zgiven raw "left", "right", "onclause" parameters consumed from
a particular key within _join(), add a real ORMJoin object to
our _from_obj list (or augment an existing one)

NzCan't construct a join from z to z, they are the same entity)r  r  _extra_criteriar[   )"_join_determine_implicit_left_side_join_place_explicit_left_sider  rI   _join_check_and_adapt_right_sider]  _get_extra_criteriar  r   rF  rG  r   )r   r  r  r  r  r~  	outerjoinr  replace_from_obj_indexuse_entity_indexr_infoextra_criterialeft_clauses   &&&&&&&&     rn   r  )ORMSelectCompileState._join_left_to_right  s     < <<
 77#5	&  334GN&  =,,)-u6  #'"G"G#
x ###!55f=NN!- ++,BCK !!"9#9:#  )!(6	
 ##$:Q$>$@AB    + "'9=    2CNN" $ 1 1%$2	5 	!Drm   c                   \        V4      pR;rgV P                  '       d   \        P                  ! V P                  VP                  V4      p\        V4      ^8X  d   V^ ,          pV P                  V,          pEMu\        V4      ^8  d   \        P                  ! R4      h\        P                  ! RV: R24      hV'       Ed   / p	\        V4       F`  w  rVP                  pVf   K  \        V4      pWJ d   K)  \        V\        4      '       d   W3WP                  &   KP  RV3WP                  &   Kb  	  \        V	P                  4       4      p\        P                  ! WP                  V4      p\        V4      ^8X  d   WV^ ,          ,          ,          w  rrMW\        V4      ^8  d   \        P                  ! R4      h\        P                  ! RV: R24      h\        P                  ! R4      hW&V3# )zWhen join conditions don't express the left side explicitly,
determine if an existing FROM or entity in this query
can serve as the left hand side.

Na  Can't determine which FROM clause to join from, there are multiple FROMS which can join to this entity. Please use the .select_from() method to establish an explicit left side, as well as providing an explicit ON clause if not present already to help resolve the ambiguity.zDon't know how to join to z. Please use the .select_from() method to establish an explicit left side, as well as providing an explicit ON clause if not present already to help resolve the ambiguity.zgNo entities to join from; please use select_from() to establish the left entity/selectable of this join)r    r  rm  find_left_clause_to_join_fromr   r:  r  rI  	enumerateentity_zero_or_selectablerF  rG  rJ  keys)r   r  r  r  r  r  r  r  indexes	potentialentity_indexrH  r  ent_infoall_clausess   &&&&&          rn   r  8ORMSelectCompileState._join_determine_implicit_left_side  s   & 488 <<!!6#4#4hG 7|q )0&(()?@W!005  00
 9>	@  !  I%./B%C!66>"6?%
 c=111=0FInn-6:F^I112 &D  y~~/0K<<..G 7|q )2wqz3J)K& $W!005  00
 9>	@  ,,1  -===rm   c                   R;r4\        V4      pV P                  '       dc   \        P                  ! V P                  VP                  4      p\        V4      ^8  d   \        P                  ! R4      hV'       d
   V^ ,          pVfd   V'       d\   \        VR4      '       dJ   \        V4       F:  w  rx\        V\        4      '       g   K  VP                  V4      '       g   K6  Tp W43# 	  W43# )zWhen join conditions express a left side explicitly, determine
where in our existing list of FROM clauses we should join towards,
or if we need to make a new join, and if so is it from one of our
existing entities.

NzrCan't identify which entity in which to assign the left side of this join.   Please use a more specific ON clause.r5  )r    r  rm  #find_left_clause_that_matches_givenr   r:  r  rI  rw  r  rF  rG  corresponds_to)	r   r  r  r  r  l_infor   idxrH  s	   &&&      rn   r  4ORMSelectCompileState._join_place_explicit_left_sideY  s    2 598BB!!6#4#4G 7|a00!  )0& #*#))%&9: c=11c6H6H6N6N'*$%77 ; &77rm   c           
     (	   \        V4      p\        V4      pRp\        VRR4      pV'       d   VP                  '       g+   \        VP                  \
        P                  4      '       d|   V P                  ;'       g    VP                  . FV  p	\        P                  ! VP                  V	4      '       g   K,  \        P                  ! WP                  4      '       g   KT  Rp M	  V'       dB   VP                  VP                  J d(   \        P                  ! RVP                  ,          4      h\        VRR4      VP                  \        VRR4      rpV'       dH   V'       d@   VP                  VP                  4      '       g   \        P                  ! RV: RV: 24      h\        VR4      '       d   V ;P                   V3,          un        RpVP"                  '       Ed   V'       d   VP                  pV
P$                  '       d   V P'                  4       pVe
   V! VR4      pMV'       d   V
P)                  VP                  4      '       g>   \        P                  ! R	V
P*                  : R
VP                  P*                  : R24      h\        V
\
        P,                  4      '       d(   \.        P0                  ! \2        P4                  V
4      p
Rp\7        W4      p\8        P:                  ! RV,          RRR7       T;'       d    V'       * ;'       d    TpV'       g7   V'       d/   \7        VRR7      pRp\8        P<                  ! RV,          RR7       V'       dL   V'       g   Q h\?        \@        PB                  \        V4      VPD                  R7      pV PG                  W4       MmVP"                  '       g\   V'       gT   VPH                  '       dB   V PG                  V\?        \@        PJ                  VVP                  VPD                  R7      4       \        V\
        PL                  4      '       d"   V P'                  4       pV'       d
   V! VR4      pV'       d'   V ;PN                  WVPP                  33,          un'        \        V4      W#3# )ztransform the "right" side of the join as well as the onclause
according to polymorphic mapping translations, aliasing on the query
or on the join, special cases where the right and left side have
overlapping tables.

Fr5  NTz*Can't join table/selectable '%s' to itselfrM  zJoin target z9 does not correspond to the right side of join condition zSelectable 'z' is not derived from ''zAn alias is being generated automatically against joined entity %s for raw clauseelement, which is deprecated and will be removed in a later release. Use the aliased() construct explicitly, see the linked example.z1.4xaj1)code)flatzAn alias is being generated automatically against joined entity %s due to overlapping tables.  This is a legacy pattern which may be deprecated in a later release.  Use the aliased(<entity>, flat=True) construct explicitly, see the linked example.xaj2rv  )r   rL  ))r    r#  with_polymorphicrF  rN  r$   Joinr  r   rm  selectables_overlapr  rI  common_parentr5  rw  r3  is_clause_element_is_lateralr  is_derived_fromdescriptionrN   r#   r  r%   FromClauseRoler   r"   warn_deprecatedwarnr   r    DEPRECATED_JOIN_ADAPT_RIGHT_SIDErR  rP  #_has_aliased_polymorphic_fromclause#WITH_POLYMORPHIC_ADAPTER_RIGHT_JOINClauseElementr  r"  )r   r  r  r  r~  r	  r  overlapright_mapperr}  right_selectableright_is_aliasedneed_adapterr  aliased_entityrZ  s   &&&&&           rn   r  6ORMSelectCompileState._join_check_and_adapt_right_side  s    vx6 ))),99:??KK --DD&2C2C1DD//%%x 22//  #G E v((F,=,==,,<##$  FHd+F.6 )9  ..t{{;;,,9>J  68$$F9, ####{{+++ #'";";"=". ,E48E (77 33  !44 -88(;;GG  .
0E0EFF'0'7'7,,.>($ $(L %\D$$D
 ## 	 &JJ.>*>JJ7 !T2ELII@
 COO    < @@(<<G 33LJ((($@@@ 33#GG +66 , @ @	 h
 8 899"779O*8T: &&D+B*DD&u~u..rm   c                	   R V P                   P                  RV P                   P                  RV P                  RV P                  RV P                   P
                  RV P                   P                  RV P                  ;'       g    RRV P                   P                  R	V P                   P                  R
V P                   P                  RV P                   P                  /# )r  r  rB  r@  r  r  r<  Nr  r  r  r  )r   r  r  rB  r@  r  r  r<  r  r  r  r  r   s   &rn   r  "ORMSelectCompileState._select_argsX	  s     D11??T22AA4++--77--77--D11??"%%;; 5 5 G G#%%<<
 	
rm   c                	   V P                   pVP                  R 4      RJ;'       gb    VP                  R4      RJ;'       gG    VP                  RR4      ;'       g-    VP                  RR4      ;'       g    VP                  RR4      # )r  Nr  rB  Fr@  r<  r[   )r  r   )r   kwargss   & rn   rK  -ORMSelectCompileState._should_nest_selectablel	  s    ""JJ~&d2 - -zz/*$6- -zz*e,- - zz-,- - zz*e,	
rm   c                	   a a R SP                   3S P                  9   do   \        ;QJ d5    . VV 3R lS P                  R SP                   3,           4       F  NK  	  5# ! VV 3R lS P                  R SP                   3,           4       4      # R# )additional_entity_criteriac              3     <"   T FS  pVP                   '       g   VP                  SJ g   K'  VP                  S4      '       g   K@  VP                  S4      x  KU  	  R # 5ir   )include_aliasesr  _should_include_resolve_where_criteria)r   aerS  r   s   & rn   r   <ORMSelectCompileState._get_extra_criteria.<locals>.<genexpr>|	  sZ      B &&&"))x*?	 5
 &&t, 5**844s   AAAAr[   )r5  r   r   )r   rS  s   ffrn   r  )ORMSelectCompileState._get_extra_criteriaw	  s    (OO
 ##$ 5 0018??C5 5 0018??C   Irm   c                z   V P                    F  pVP                  P                  RR4      pV'       g   K)  VP                  P                  f    RVP                  3V P
                  9   g   K`  W P                  9  g   Kr  TVP                  '       d   VP                  MR3V P                  V&   K  	  \        V P                  P                  4       4      pV F  w  r$W P                  9   d   K  VP                  P                  pV P                  P                  '       d   . pMV P                  V4      pVe
   We3,          pV P                  4       pV F`  pV'       d   VP!                  V4      pV'       d#   \"        P$                  ! VRR/4      pV! VR4      pV ;P&                  V3,          un        Kb  	  K  	  R# )a  Apply extra criteria filtering.

For all distinct single-table-inheritance mappers represented in
the columns clause of this query, as well as the "select from entity",
add criterion to the WHERE
clause of the given QueryContext such that only the appropriate
subtypes are selected from the total results.

Additionally, add WHERE criteria originating from LoaderCriteriaOptions
associated with the global context.

rf  Nr.  r  TF)r  r^  r   r5  _single_table_criterionr   r  rM  ry  r  r  r3  r   r   r  r  traverserm  _deep_annotater7  )	r   
fromclauserS  r  rZ  single_critr.  r  r&  s	   &        rn   rH  0ORMSelectCompileState._adjust_for_extra_criteria	  s|    ++J!..22>4HH OO;;G4hooF--. $@$@@ )1)B)B)BH%%:,,X6 ," T1188:;!'H..."//AAK##666-/*-1-E-Eh-O*&*n<*"779O2"++D1D"#224,9MND*47D$$/$ 3 "(rm   )!r   r  r  r  r9  r3  r  r  r   r   r7  r   r  rD  rF  r   r  r  rB  r@  r  r  r  r  r  r<  r  r  r  r  r   rr   r  r[   r   )2r\   r]   r^   r_   r  r   r  r  ra  r  r  r  r  rD  rF  r7  r9  r   r  r   r  r_  rY  rb  ri  rn  r4  rs  rN  r  r  r  r{  rL  rM  r  r  r  r  r6  r  r  r  r  rb  r  rK  r  rH  rl   r[   rm   rn   r  r  -  si   $O #!IO` `D
5KZ  2 @ @
 8 8 
 
   "+8(0#"Yv(KZ/$.`[zaFh>T@8D{/z 
 
& 
 
 70rm   r  c               (    V ^8  d   QhRRRRRRRR/# )	rq   query_or_select_stmtz#Union[Query, Select, FromStatement]rT   zOptional[ORMSelectCompileState]r  r   r   zList[ORMColumnDescription]r[   )rz   s   "rn   r{   r{   	  s0      =2   	rm   c                   Vf   \         P                  WR7      pTpVP                   Uu. uF  qDVP                  3NK  	  up UUu. uFg  w  rVRVP                  RVP
                  R\        VRR4      RVP                  RVP                  e    VP                  '       g   \        VRR 4      MR /NKi  	  pppV# u upi u uppi )	N)r  r&  typealiasedrM  Fexprr  )	r  r_  r   r  _label_namer@  r#  rB  r  )r>  rT   r  r<  _entrH  insp_entds   &&&     rn   r+  r+  	  s    
 -II  J 
 C 25
1>4##$
	
MC COOCHHwx);UCCHH??. 222 (D1 	

  	" H	
	s   B9AB> B>c                    V ^8  d   QhRRRR/# rq   query_or_augmented_selectzUnion[Query[Any], Select[Any]]r   "Optional[_InternalEntityType[Any]]r[   )rz   s   "rn   r{   r{   	  s     + +=+'+rm   c                   T pVP                   '       d   VP                  pVe   V# VP                  '       dG   RVP                  ^ ,          P                  9   d%   VP                  ^ ,          P                  R,          # \	        V4      # )Nrf  )r5  _last_joined_entityr  r^  _entity_from_pre_ent_zero)rI  r   rL  s   &  rn   _legacy_filter_by_entity_zerorN  	  sq     %D"66*&&~~~.DNN1,=,J,JJ~~a --n==$T**rm   c                    V ^8  d   QhRRRR/# rH  r[   )rz   s   "rn   r{   r{   	  s      ='rm   c                ,   T pVP                   '       g   R # VP                   ^ ,          pRVP                  9   d   VP                  R,          # \        V\        4      '       d   VP                  # RVP                  9   d   VP                  R,          # V# )Nrf  bundle)r  r^  rF  r   r  )rI  r   rH  s   &  rn   rM  rM  	  s     %D


A
C)))//	C-	.	.zz	S%%	%))
rm   c               $    V ^8  d   QhRRRRRR/# )rq   rX  zTuple[_SetupJoinsElement, ...]r  rJ  r   z=Optional[Union[_InternalEntityType[Any], _JoinTargetElement]]r[   )rz   s   "rn   r{   r{   
  s'      /3 Crm   c                    V '       g   R # V R,          w  r#rE\        V\        P                  4      '       d   VP                  # V# )N)rF  r   r  r  )rX  r  targetr  r  r  s   &&    rn   rW  rW  
  sB     '22$Vu%%  }}rm   c                      ] tR tRt$ RtRtR]R&   RtRtRt	R]R&   R]R	&   R
]R&   R]R&   R R lt
R R ltR t]R 4       tRtR# )r  i
  z:represent an entity column returned within a Query result.r   supports_single_entityFzOptional[str]rC  z!Union[Type[Any], TypeEngine[Any]]r@  z.Union[_InternalEntityType, ColumnElement[Any]]rB  zOptional[_InternalEntityType]r  c                    V ^8  d   QhRRRR/# )rq   rT   rX   r   Noner[   )rz   s   "rn   r{   _QueryEntity.__annotate__#
  s     $ $ $T $rm   c                	    \        4       hr   r   r   rT   s   &&rn   r   _QueryEntity.setup_compile_state#
  r
  rm   c               $    V ^8  d   QhRRRRRR/# rq   rT   rX   rZ  z Optional[_DMLReturningColFilter]r   rY  r[   )rz   s   "rn   r{   rZ  &
  s(     $ $&$ 2$ 
	$rm   c                	    \        4       hr   r   r   rT   rZ  s   &&&rn   r  ._QueryEntity.setup_dml_returning_compile_state&
  s    
 "##rm   c                	    \        4       hr   r   )r   r?  r   s   &&&rn   row_processor_QueryEntity.row_processor-
  r
  rm   c                	   \        V4       EFh  w  rVVP                  '       d?   VP                  '       d!   V P                  VVP                  VV4       KJ  VP                  pVP
                  '       d   VP                  '       dG   R VP                  9   d   \        VVVV4       K  \        P                  VVP                  VVV4       K  VP                  P                  RR4      '       d   \        VVVV4       K  VP                  '       d'   \        P                  VVP                  VVV4       EK*  \        P                  VV.VVV4       EKG  VP                  '       g   EK\  \        WV4       EKk  	  V# )rf  rQ  F)r  _is_lambda_element_is_sequencer  	_resolvedr  r]  r^  rG  _ColumnEntity_for_columns_select_iterabler   _BundleEntity_is_clause_list	is_bundle)r   rT   r  r  r  r
  r  s   &&&&&  rn   r  _QueryEntity.to_compile_state0
  sb    %X.KC(((&&&((%((++	 #--F''''''%)<)<<%)"//	 &22)"33// **..x??%)"//	  /// &22)"33// &22)#H// !!!m5HIs /v #"rm   r[   N)r\   r]   r^   r_   r   r   r   _non_hashable_value_null_column_typeuse_id_for_hashr  r  rd  r   r  rl   r[   rm   rn   r  r  
  s\    DI  O
++
88..$$$ ># >#rm   r  c                      ] tR tRt$ RtRtR	]R&   R
]R&   R	]R&   R]R&   R]R&   R]R&   R tRtRt	Rt
]R 4       t]R 4       tR tR tR tR R ltR tRtR# )rG  ir
  z mapper/class/AliasedClass entityrB  r5  r  rM  pathrC  r=   zMapper[Any]r   r   strc                	   VP                  V 4       V'       d#   VP                  f   Wn        RVn        RVn        VP                  R,          pVP
                   T;qPn        VP                  pW n        VP                  ;V n	        pV P                  3V n
        VP                  '       d   VP                  V n        MVP                  P                  V n        VP                  V n        VP                   V n        VP$                  V n        VP&                  V n        VP*                  V n        VP.                  '       d   VP1                  WPP$                  4       R # R # )NTrf  )r  r   ra  r  r^  _post_inspectr  r  rB  r5  _extra_entitiesrM  r&  rC  class_r\   r   ru  r   with_polymorphic_mappersrX  polymorphic_on_polymorphic_discriminator _should_select_with_poly_adapterrU  )r   rT   r  r  r  rS  r5  s   &&&&&  rn   r   _MapperEntity.__init__
  s    	""4(,,404-15M..2M+$$^4&,,#	'.f $		|$$$'}}D%}}55D ( 9 9++	"--)1)J)J&*2*A*A'222::// 3rm   Tc                	.    V P                   P                  # r   )r5  rz  r   s   &rn   r@  _MapperEntity.type
  s    {{!!!rm   c                	    V P                   # r   )r  r   s   &rn   r  '_MapperEntity.entity_zero_or_selectable
  s    rm   c                	.    \        V P                  V4      # r   )r   r  r   r  s   &&rn   r  _MapperEntity.corresponds_to
  s    %d&6&6??rm   c                	\   R pV P                   '       g:   VP                  '       d'   VP                  P                  V P                  R 4      pMV P                  P
                  pV'       d5   VP                  '       d   VP                  VP                  4      pV# Tp V# VP                  pV# r   )rM  r   r   r5  r  ry  r  wrap)r   rT   rZ  rets   &&  rn   _get_entity_clauses!_MapperEntity._get_entity_clauses
  s    $$$222'==AAKK &&//G,,,ll=#@#@A 
	  
  //C
rm   c                	   VP                   pV P                  V4      pVP                  '       d%   V'       d   VP                  VP                  4      pMV'       g   VP                  pVP                  V J d$   VP
                  P                  pVP                  pMR ;rV\        P                  ! V V P                  VVV P                  VVVV P                  R7	      pWpP                  V P                  3# )N)only_load_propsr   polymorphic_discriminator)rT   r  r  r  r   r   r   r   r   _instance_processorr5  ru  r}  rC  ry  )r   r?  r   rT   rZ  r  r   	_instances   &&&     rn   rd  _MapperEntity.row_processor
  s    --**=9///Gll=#G#GHG#::G((D0+;;LLO#11M.22O//KKII+'&*&E&E

	 **D,@,@@@rm   c               $    V ^8  d   QhRRRRRR/# r_  r[   )rz   s   "rn   r{   _MapperEntity.__annotate__
  s(     
 
&
 2
 
	
rm   c                	    \         P                  ! VV P                  V V P                  VVP                  V P
                  VP                  P                  V P                  R 7	       R# )r  r  r  N)	r   _setup_entity_queryr5  ru  r  rX  r   r   r}  ra  s   &&&rn   r  /_MapperEntity.setup_dml_returning_compile_state
  sS    
 	##KKII))!;;)99JJ&*&E&E
	
rm   c                	    V P                  V4      pV P                  P                  pVf   RV P                  3VP                  9   d<   V P                  pTVP
                  '       d   VP                  MR 3VP                  V&   \        P                  ! VV P                  V V P                  VVP                  V P                  VP                  P                  V P                  R7	       VP                   P#                  V P$                  4       R # )Nr.  r  )r  r5  r7  r   r  rM  ry  r  r   r  ru  r  rX  r   r   r}  r  r  r   )r   rT   rZ  single_table_critrS  s   &&   rn   r  !_MapperEntity.setup_compile_state  s    **=9 KK??),dkk:../ ''H%-%>%>%>!!D?M11(;
 	##KKII))!;;)99JJ&*&E&E
	
 	,,33DOODrm   )
ry  rC  r}  rX  r  rB  rM  r5  ru  r   N)
rB  r5  r  rM  ru  ry  rC  rX  r   r}  )r\   r]   r^   r_   r   r   r   r   rW  rq  rs  rb  r@  r  r  r  rd  r  r  rl   r[   rm   rn   rG  rG  r
  s    *I $$
#J "O" "    @*A:
"Erm   rG  c                      ] tR tRt$ RtRtR]R&   R	]R&   R
]R&   R]R&   R]R&   R	]R&   RR lt]R 4       t	]R 4       t
R t]R 4       tR tR R ltR tRtR# )rm  i  rQ  rB  r@  rC  r   rW  r   r   z	Type[Any]rv  r   Nc           
     	   R Vn         VP                  R,          pV'       d   VP                  P                  V 4       MVP                  V 4       \	        V\
        P                  \        P                  34      '       d   VP                  4       pMTpV;V n
        V n        \        V4      V n        VP                  V n        . V n        V'       d{   VP                   Fj  pRVP                  9   d   \!        VVVVV R7       K&  \	        V\"        4      '       d   \!        VVVVV R7       KN  \$        P'                  VV.VRVV R7       Kl  	  V P                  P(                  V n        R# )TrQ  parent_bundleN)r  r^  r   r  rF  r   r  r   r  rg  rQ  rB  r@  r&  rC  exprsrm  r   _ORMColumnEntityrk  single_entityrW  )r   rT   rB  r  r  setup_entitiesr  rQ  s   &&&&&&& rn   r   _BundleEntity.__init__1  s>    +/'  *##**40&&t,:00*2K2KL
 
 ,,.FF"((diL	!;;t000!%++&*  f--!%++&* %11%++&* 2 % %6 '+kk&?&?#rm   c                	>    V P                   pVe   VP                  # R # r   )r  r5  )r   rR  s   & rn   r5  _BundleEntity.mapperl  s       <<rm   c                	T    V P                    F  pVP                  pVf   K  Vu # 	  R # r   )r   r  r   rH  rR  s   &  rn   r  _BundleEntity.entity_zerot  s)    >>COOE  "
 rm   c                	    R # Fr[   r  s   &&rn   r  _BundleEntity.corresponds_to}  s     rm   c                	T    V P                    F  pVP                  pVf   K  Vu # 	  R # r   )r   r  r  s   &  rn   r  '_BundleEntity.entity_zero_or_selectable  s+    >>C11E  "
 rm   c                	N    V P                    F  pVP                  V4       K  	  R # r   )r   r  )r   rT   rH  s   && rn   r  !_BundleEntity.setup_compile_state  s    >>C##M2 "rm   c               $    V ^8  d   QhRRRRRR/# r_  r[   )rz   s   "rn   r{   _BundleEntity.__annotate__  (     7 7&7 27 
	7rm   c                	$    V P                  V4      # r   r  ra  s   &&&rn   r  /_BundleEntity.setup_dml_returning_compile_state      
 ''66rm   c           	     	    \        V P                   Uu. uF  q3P                  W4      NK  	  up!  w  rEpV P                  P	                  VP
                  WE4      pWpP                  V P                  3# u upi r   )r   r   rd  rQ  create_row_processorr   rC  ry  )r   r?  r   rH  procslabelsextraprocs   &&&     rn   rd  _BundleEntity.row_processor  si    "<@NNKNS0NK 
u {{//uM%%t';';;; Ls   A3)r   rC  rQ  rB  rW  r@  r[   )rQ  rB  r@  rC  r   rW  r$  )r\   r]   r^   r_   ry  r   r   r   rb  r5  r  r  r  r  r  rd  rl   r[   rm   rn   rm  rm    s    OI "!N
O  
L9@v    
  37<rm   rm  c                  d    ] tR tRtR	t]R
R l4       t]R 4       t]R 4       t	]R 4       t
R tRtR# )rj  i  Nc                	$   V F  pVP                   pR V9   d   VR ,          p	M\        P                  ! VR 4      p	V	'       d:   RVP                   9   d   \        VVVV	VVVR7       Kd  \	        VVVV	VVVR7       Kx  \        VVVVVVR7       K  	  R# )rf  r   r  N)r^  rm  extract_first_column_annotation_IdentityTokenEntityr  _RawColumnEntity)
r   rT   rh  r  raw_column_indexr  r  columnr   _entitys
   &&&&&&&   rn   rk  _ColumnEntity._for_columns  s     F --K,%n5"BBN #v':'::(%+(+&3 %%+(+&3 !!'$'"/? rm   c                	.    V P                   P                  # r   )r  r@  r   s   &rn   r@  _ColumnEntity.type  s    {{rm   c                	L    V P                   P                  P                  '       * # r   )r  r@  hashabler   s   &rn   rq  !_ColumnEntity._non_hashable_value  s    ;;##,,,,rm   c                	B    V P                   P                  P                  # r   )r  r@  _isnullr   s   &rn   rr  _ColumnEntity._null_column_type  s    {{'''rm   c                	@   VP                   pV P                  eU   V P                  w  rEpV P                  '       d0   VVP                  P                  V P
                  ,          3,          pWEV3# V P                  e   V P                  pM]V P                  pVP                  '       d   VP                  P                  V,          pVP                  '       d   VP                  4       pVP                  '       d   VP                  P                  V,          pVP                  V4      pW@P                  V P                  3pWn        V P                  '       dH   V P                  VP                  P                  V P
                  ,          3,           pW@P                  V3# V# r   )rT   _row_processortranslate_raw_columnr   r  r  _fetch_columnr  r  rh  r^  _deannotater  _getterrC  ry  )	r   r?  r   rT   getter
label_nameextra_entitiesr  r  s	   &&&      rn   rd  _ColumnEntity.row_processor  sl   -- *151D1D.F(((MM..t/D/DE#  ~55 )''F [[F ,,,&66>>vF"""  ++-///"99AA&IF'&&(<(<<!$$$!11**4+@+@A5 N ++^;;Jrm   )r  )r  r  r  r  r   )r\   r]   r^   r_   r   r   rk  rb  r@  rq  rr  rd  rl   r[   rm   rn   rj  rj    s_    I / /b     - - ( (0rm   rj  c                  H    ] tR tRtRtRtRtR
tRR ltR t	R R lt
R tR	tR# )r  i  NFc                	z   W n         W@n        VR JV n        VP                  '       d   V;P                  RR/,          un        V'       d   VP
                  '       d	   R V n        M0V'       d   VP                  V n        MVP                  V4      V n        V'       d   VP                  P                  V 4       MVP                  V 4       W n        V P                  P                  '       d   V P                  P                  ^ ,          MR V n        V P                   V P                  3V n        R ;V n        V n        R # )Nr   T)rB  r  r  r   r   _is_text_clauserC  
_proxy_keyr  r   r  r  r  r  ry  r  r  )r   rT   r  r  r  r  r  s   &&&&&&&rn   r   _RawColumnEntity.__init__&  s     	 0$4D$@!???))j$-??)"f&<&<&<#D#)#4#4 #0#B#B6#J ##**40&&t,,0KK,E,E,EDKK%%a(4 	& !%		4;;7377T0rm   c                	    R # r  r[   r  s   &&rn   r  _RawColumnEntity.corresponds_toJ  s    rm   c               $    V ^8  d   QhRRRRRR/# r_  r[   )rz   s   "rn   r{   _RawColumnEntity.__annotate__M  r  rm   c                	$    V P                  V4      # r   r  ra  s   &&&rn   r  2_RawColumnEntity.setup_dml_returning_compile_stateM  r  rm   c                	>   VP                  4       pV'       d   V! V P                  R 4      pVf   R# MV P                  pVP                  '       d   VP                  4       pVP                  P                  V4       VP                  P                  V4       W0n        R# FN)	r  r  r^  r  r  r  r  r  r  )r   rT   r  r  s   &&  rn   r  $_RawColumnEntity.setup_compile_stateT  s    '<<>$T[[%8F~  [[F '')F$$((0%%,,V4#rm   )	ry  r  rC  r  r  r  rB  r  r  )rB  r  rC  r  ry  r   )r\   r]   r^   r_   r  r5  rW  r   r   r  r  r  rl   r[   rm   rn   r  r    s.    KF"I"8H7$rm   r  c                  D    ] tR tRtRtRtRtRR ltR tR R lt	R	 t
R
tR# )r  ig  zColumn/expression based entity.FNc                	   VP                   pTp	VP                  ! R R4      p
VP                  ! RV	4      pV
'       d$   \        VP                  V
4      V n        RV n        MW n        VRJV n        WPn        V'       d=   V'       d   V
'       d   T
MVP                  V n        MVP                  W*R7      V n        MRV n        V	P                   T	;V n        ;V n        pV	P                  ;V n        pV'       d   VP                  P                  V 4       MVP                  V 4       RVn        W n        R;V n        V n        V P                  V P"                  3V n        VP*                  '       d   VP-                  WP.                  4       R# R# )	proxy_keyNproxy_ownerF)r%  T)r^  r   r#  r  rB  r  r  r  rC  r  rx  r  r  r5  r   r  r  r  r  r  ry  r~  rU  r   )r   rT   r  r  rf  r  r  r  r   r  orm_keyr  rR  r5  s   &&&&&&&&      rn   r   _ORMColumnEntity.__init__v  sZ    )) //+t4!oomW= 2 2G<DI(-D% I(8(DD% 0.576;L;L #0#B#B $C $   $DDKKK49E&~~-f##**40&&t,*.'377T0 $		4;;7222::'' 3rm   c                	    \        V4      '       d   WP                  J # \        V P                  4      '       * ;'       d    VP                  V P                  4      # r   )r   r  r  r  s   &&rn   r  _ORMColumnEntity.corresponds_to  sU    V$$----(    9 9&&t'7'789rm   c               $    V ^8  d   QhRRRRRR/# r_  r[   )rz   s   "rn   r{   _ORMColumnEntity.__annotate__  s(     9 9&9 29 
	9rm   c                	    V P                   ;V n        pV'       d
   V! VR 4      pVe9   VP                  P                  V4       VP                  P                  V4       R# R# r  )r  r  r  r  r  r  )r   rT   rZ  r  s   &&& rn   r  2_ORMColumnEntity.setup_dml_returning_compile_state  sW     '+kk1VVU+F((,,V4))008 rm   c                	j   VP                  4       pV'       d@   V! V P                  R 4      pVf(   VP                  '       g   Q hV P                  V n        R# MV P                  pV P                  pV P
                  P                  pVf   RV P
                  3VP                  9   d0   TVP                  '       d   VP                  MR3VP                  V&   VP                  '       d#   VP                  '       g   VP                  4       p\        V P                  P                  4      P!                  VP"                  P                  4      '       d&   VP$                  P'                  VP"                  4       VP(                  P+                  V4       VP,                  P'                  V4       W0n        R# )FNr.  )r  r  r   r  r  r5  r7  r   rM  ry  r  r^  _expression_labelr  r  r  intersectionr   r  r  r  r  r  )r   rT   r  r  rR  r  s   &&    rn   r  $_ORMColumnEntity.setup_compile_state  se   '<<>$T[[%8F~$55555%)[[" 
 [[F   KK??),dkk:../ "'"8"8"8d<M11%8
 v'?'?'? '')F t{{(()66**
 
 00778H8HI$$((0%%,,V4#rm   )ry  r  rC  r  r  r  r  rB  r5  r  r  )rB  r5  r  rC  r  r  ry  r   )r\   r]   r^   r_   r   rW  r   r   r  r  r  rl   r[   rm   rn   r  r  g  s(    )"IAF99)$rm   r  c                  &    ] tR tRtRtR tR tRtR# )r  i  Fc                	    R # r   r[   r\  s   &&rn   r  (_IdentityTokenEntity.setup_compile_state  s    rm   c                	@   a V3R  lpW0P                   V P                  3# )c                0   < SP                   P                  # r   )rw   re   )rowr?  s   &rn   r  2_IdentityTokenEntity.row_processor.<locals>.getter  s    ''777rm   )rC  ry  )r   r?  r   r  s   &f& rn   rd  "_IdentityTokenEntity.row_processor  s!    	8 '')=)===rm   r[   N)r\   r]   r^   r_   r  r  rd  rl   r[   rm   rn   r  r    s     >rm   r  r2  r   )
__future__r   r  typingr   r   r   r   r   r	   r
   r   r   r   r   r    r   r   r   baser   r   r   path_registryr   r"   r   r   r   r   r   r   r   r   r  r   r    r!   r#   r$   r%   rm  r&   sql._typingr'   r(   r)   r*   sql.baser+   r,   r-   r.   r/   r0   sql.dmlr1   sql.elementsr2   r3   sql.selectabler4   r5   r6   r7   r8   r9   r:   r;   sql.visitorsr<   _typingr=   r>   r?   r5  r@   r   rA   rv   rB   rC   enginerD   engine.interfacesrE   rF   sql.compilerrG   rH   rI   rJ   rK   rL   rM   rN   sql.type_apirO   rP   rootr   r  r   r  rS   r7  r   r   rX   rd  rx  r  
plugin_forr  r  r  r  r+  rN  rM  rW  r  rG  rm  rj  r  r  r  r[   rm   rn   <module>r     s   #                  # , , ' (  !    %         "     * ( ( ' # ! !    ) % 0 : - ; # - ( - ,,3!' <4**,3936+)T""  " *@@ q. q.h ++'. 
i$l i$X*#: *Zf
- f
R	$$ $$N>'= >&)? 0 !!%)=>wD? wD ?wDtuPNJ0@0E uPp !!%):;	 "5	 <	 !!%2P0O[ P0 3P0f,<+&$\# \#~iEL iEX<L <DvL vrK$} K$\R$} R$j
>+ 
>rm   