[uiHdZddlZddlZddlZddlZddlmZddlmZddlmZddlm Z dd lm Z dd lm Z dd lm Z dd lm Zdd lmZddlmZddlmZddlmZddlmZejdejejzZejdejejzZGddejZGddeZGddeejZ Gddeej!Z"Gddeej#Z$GddeZ%Gd d!ej&Z'e'e_(dS)"aDefault implementations of per-dialect sqlalchemy.engine classes. These are semi-private implementation classes which are only of importance to database dialect authors; dialects will usually use the classes here as the base class for their own corresponding classes. N) interfaces) reflection)result)event)exc)pool) processors)types)util)compiler) expression)schema) quoted_namez-\s*(?:UPDATE|INSERT|CREATE|DELETE|DROP|ALTER)z \s*SELECTc eZdZdZejZejZej Z ej Z dZ dZdZdZeZdZdZdZdZdZdZdZdZdZdZdZdZdZe j!de j"dfde j#fde j"d fd e j"d fd e j#fd e j#fd e j#fde j$fgZ%dZ&e j'r dZ(dZ)dZ*dZ+ndZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2iZ3dZ4dZ5dZ6dZ7dZ8dZ9dZ:dZ;dZ< dZ=dZ>e j!Z? e j@d d?dZAe jBdZCeDdZEeDdZFeGdZHeGdZIdZJd ZKd!ZLd"ZMd@d#ZNd$ZOd%ZPd&ZQd@d'ZRd(ZSd)ZTd*ZUd+ZVd,ZWd-ZXd.ZYd/ZZd0Z[d1Z\e jBd2Z]d3Z^d4Z_d5Z`d6Zad7Zbd@d8Zcd@d9Zdd@d:Zed;Zfd<Zgd=Zhd>ZidS)ADefaultDialectz!Default implementation of DialectTFrconvert_unicodeforce pool_timeoutechodebug echo_pool pool_recycle pool_size max_overflowpool_threadlocalN use_encodingdefaulti'named)z1.3zThe :paramref:`_sa.create_engine.convert_unicode` parameter and corresponding dialect-level parameters are deprecated, and will be removed in a future release. Modern DBAPIs support Python Unicode natively and this parameter is unnecessary.)rutf-8staticc  t|ddstjd|jz||_||_d|_d|_||_|||_ n%|j|jj |_ n |j |_ |||_ |j dv|_| ||_ |||_|||_|||_||_| |_| dkrd|_n+| dvrd|_| dk|_nt+jd | |_|jr |j|_| |_|jd krt7j||_n%|jt7j|j|_t=j|j|_ t7j|j|_!dS) Nported_sqla_06Tz2The %s dialect is not yet ported to the 0.6 formatF)qmarkformatnumericr#)dynamic dynamic_warnr*z?empty_in_strategy may be 'static', 'dynamic', or 'dynamic_warn'r)"getattrr warnnamerencoding positional_ischemadbapi paramstyledefault_paramstyleimplicit_returningprepareridentifier_preparer type_compilersupports_right_nested_joinssupports_native_booleancase_sensitiveempty_in_strategy_use_static_in_warn_on_empty_inr ArgumentError#_user_defined_max_identifier_lengthmax_identifier_length label_lengthdescription_encodingr to_unicode_processor_factory_description_decodercodecs getencoder_encoder_decoder) selfrr.r2r1r4r8r:r9r;r@rAkwargss /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/sqlalchemy/engine/default.py__init__zDefaultDialect.__init__s2t-t44  ID)    /     !(DOO Z #"j3DOO"5DO  )&8D #/-KK#'==#6#6 !//55 & 2/JD , " .+BD (,!2  ( ("&D   "= = ="'D %6.%HD " "#/  4I0  3 8  &)  $ 6 67))D % % & 27'))))D %)$-88 "? NN c(tjSN)weakrefWeakKeyDictionaryrIs rK _type_memoszDefaultDialect._type_memoss(***rMc&|jdz|jzS)N+)r-driverrRs rKdialect_descriptionz"DefaultDialect.dialect_descriptionsy3,,rMc|jS)zTrue if this dialect supports sane rowcount even if RETURNING is in use. For dialects that don't support RETURNING, this is synonymous with ``supports_sane_rowcount``. )supports_sane_rowcountrRs rK supports_sane_rowcount_returningz/DefaultDialect.supports_sane_rowcount_returnings **rMc8t|dtjS)N poolclass)r+r QueuePool)clsurls rKget_pool_classzDefaultDialect.get_pool_class)ssK888rMcd|jddd} t|dzdS#t$rYdSwxYw)N.rz .provision)join __module__split __import__ ImportError)r^packages rKload_provisioningz DefaultDialect.load_provisioning-sl((3>//44QrT:;;  w- . . . . .    DD sA AAc |||_n#t$r d|_YnwxYw |||_n#t$r d|_YnwxYw ||j|_n#t$r d|_YnwxYw|||_ |j #| |rdx|_ |_ |j s||}|r||_|jr3|j|jkr%t#jd|j|jfzdSdS)NzQLabel length of %d is greater than this dialect's maximum identifier length of %d)_get_server_version_infoserver_version_infoNotImplementedError_get_default_schema_namedefault_schema_nameget_default_isolation_level connectiondefault_isolation_level_check_unicode_returnsreturns_unicode_stringsrB_check_unicode_descriptionrDr?_check_max_identifier_lengthr@rAr r>)rIrrmax_ident_lengths rK initializezDefaultDialect.initialize5s ,'+'D'D((D $ $# , , ,'+D $ $ $ , ,'+'D'D((D $ $# , , ,'+D $ $ $ , 0+/+K+K%,,D ( (# 0 0 0+/D ( ( ( 0(,'B'B:'N'N$  % 1// ;; 2EI HD %(A7 >#@@LL  >-=*   !D$>>>#3$d&@AB    >>s/11AA$#A$(BBBcdSrOr!rRs rK on_connectzDefaultDialect.on_connectastrMcdS)zPerform a connection / server version specific check to determine the max_identifier_length. If the dialect's class level max_identifier_length should be used, can return None. .. versionadded:: 1.3.9 Nr!)rIrrs rKrwz+DefaultDialect._check_max_identifier_lengthes trMc,||S)aGiven a DBAPI connection, return its isolation level, or a default isolation level if one cannot be retrieved. May be overridden by subclasses in order to provide a "fallback" isolation level for databases that cannot reliably retrieve the actual isolation level. By default, calls the :meth:`_engine.Interfaces.get_isolation_level` method, propagating any exceptions raised. .. versionadded:: 1.3.22 )get_isolation_levelrI dbapi_conns rKrqz*DefaultDialect.get_default_isolation_levelqs'' 333rMctjrjs tjn tjjrnifdtjtj dtj dtjtj dtj dg}|r||z }fd|D}| ddgrdS|dhkS) Nctj|g} j}|||}|t|dtj S#tj $r"}tj d|zYd}~dSd}~wwxYw)Ndialectrz2Exception attempting to detect unicode returns: %rF)rselectcompilerrcursor_cursor_executefetchoneclose isinstancer text_typer DBAPIErrorr,) test statementrrowdecast_torr parametersrIs rK check_unicodez.check_unicodes!4&))11$1??I :#.5577**69jIIIoo'' "#a&$.999>    1356uuuuu sAB--C<CCz'test plain returns'<z'test unicode returns'c&h|] }|Sr!r!).0rrs rK z8DefaultDialect._check_unicode_returns..s#9994==&&999rMTF conditional)r py2ksupports_unicode_statements binary_typerr/execute_sequence_formatrcastliteral_columnsqltypesVARCHARUnicode issuperset)rIrradditional_teststestsresultsrrrs`` @@@rKrtz%DefaultDialect._check_unicode_returnss3 9 %T= %&GGnG ? 5577JJJ : : : : : : : :, O)*@AA $$   O)*BCC $$      & % %E99995999   tUm , , % =tf$ $rMc tjr|js tj}n tj}|j} ||tj tj d dg |t|jddtj|S#|wxYw)Nz'x' some_labelrr)r rrrrrrrexecuterrrlabelrr descriptionr)rIrrrrs rKrvz)DefaultDialect._check_unicode_descriptions 9 %T= %&GGnG&--//  NN%#2599?? MMNgdg++   f03A6GG LLNNNNFLLNNNNs BC00Dc6tj||jS)a)Provide a database-specific :class:`.TypeEngine` object, given the generic object which comes from the types module. This method looks for a dictionary called ``colspecs`` as a class or instance-level variable, and passes on to :func:`_types.adapt_type`. )r adapt_typecolspecs)rItypeobjs rKtype_descriptorzDefaultDialect.type_descriptors"7DM:::rMc btj|}|j||||fi|SrO)r Inspector from_engine reflecttable)rIrrtableinclude_columnsexclude_columns resolve_fksoptsinsps rKrzDefaultDialect.reflecttablesG#// ;; t ?O[  DH   rMc (d|j||fd|i|iS)zCompatibility method, adapts the result of get_primary_keys() for those dialects which don't implement get_pk_constraint(). constrained_columnsr)get_primary_keys)rIconn table_namerkws rKget_pk_constraintz DefaultDialect.get_pk_constraints= "#84#8j$$)/$35$$  rMcrt||jkrtjd||jfzdS)Nz7Identifier '%s' exceeds maximum length of %d characters)lenr@r IdentifierError)rIidents rKvalidate_identifierz"DefaultDialect.validate_identifiersF u::2 2 2%I$456  3 2rMc&|jj|i|SrO)r1connect)rIcargscparamss rKrzDefaultDialect.connects!tz!54G444rMcf|}||jg|gSrO)translate_connect_argsupdatequery)rIr_rs rKcreate_connect_argsz"DefaultDialect.create_connect_argss1))++ CIDzrMcd|vr)|dtj|dfd}d|vrCtj|d|_tj|dfd}dSdS)Nisolation_levelengine_connectc<|s|dSdSrO)_set_connection_isolation)rrbranchrrIs rK set_isolationzBDefaultDialect.set_engine_execution_options..set_isolations4P22:OOOOOPPrMschema_translate_mapc|_dSrO)schema_for_object)rrrgetters rKset_schema_translate_mapzMDefaultDialect.set_engine_execution_options..set_schema_translate_maps/5 ,,,rM)r listens_forr_schema_getterr)rIenginerrrrrs` @@rKset_engine_execution_optionsz+DefaultDialect.set_engine_execution_optionss  $ $"#45O  v'7 8 8 P P P P P9 8 P "T ) )*40F+GHHF'-F $  v'7 8 8 6 6 6 69 8 6 6 6 * )rMcd|vr|||dd|vr#tj|d}||_dSdS)Nrr)rrrr)rIrrrrs rK set_connection_execution_optionsz/DefaultDialect.set_connection_execution_optionss`  $ $  * *:t>>0BII  &     rMcdSrOr!rIdbapi_connections rKdo_beginzDefaultDialect.do_begin* rMc.|dSrO)rollbackrs rK do_rollbackzDefaultDialect.do_rollback-s!!#####rMc.|dSrO)commitrs rK do_commitzDefaultDialect.do_commit0s!!!!!rMc.|dSrO)rrs rKdo_closezDefaultDialect.do_close3s     rMcnttjdg|S)Nrr)strrrrrRs rK_dialect_specific_select_onez+DefaultDialect._dialect_specific_select_one6s.:$aS))11$1??@@@rMc2d} |} ||j|n#|wxYw dS#|jj$r#}||||rYd}~dSd}~wwxYwNTF)rrrrr1Error is_disconnect)rIrrerrs rKdo_pingzDefaultDialect.do_ping:s %,,..F t@AAA  4 z   !!#'7@@ uuuuu  s3A$AA$AA$$B3BBBc8dtjdddzzS)zCreate a random two-phase transaction ID. This id will be passed to do_begin_twophase(), do_rollback_twophase(), do_commit_twophase(). Its format is unspecified. z _sa_%032xrr)randomrandintrRs rK create_xidzDefaultDialect.create_xidJsV^AqCx8888rMcT|tj|dSrO)rrSavepointClauserIrrr-s rK do_savepointzDefaultDialect.do_savepointSs':5d;;<<<<.processs E> !rMr!)rIrr`s rKliteral_processorz!_RendersLiteral.literal_processors " " "rMN)r+rer,rar!rMrKr\r\s#rMr\ceZdZdS) _StrDateTimeNr+rer,r!rMrKrcrcDrMrcceZdZdS)_StrDateNrdr!rMrKrgrgrerMrgceZdZdS)_StrTimeNrdr!rMrKririrerMriceZdZejZejZejZ ej Z dZ dZ dZdZdZdZejeejeejeiZdS)StrCompileDialectTFN)r+rer,rStrSQLCompilerr/r0r1StrSQLTypeCompilerr7r3r5r:r;r<r4r9rArDateTimercDatergTimerirr!rMrKrkrksr!0'L/M*H).&"%)" < x xHHHrMrkcpeZdZdZdZdZdZdZdZdZ dZ dZ dZ dZ dZdZdZejZedZedZdZedZedZejdZejd Zejd Zejd Zejd Zejd Z ejdZ!dZ"e#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.e#dZ/dZ0dZ1dZ2dZ3d Z4d!Z5d"Z6 d+d#Z7d$Z8dZ9 d,d&Z:d'Z;d(ZdS)-DefaultExecutionContextFNcz||}||_||_|j|_|x|_}d|_|j|_|jr8t|j|_|j |j|j s?tj ||_ ||j d|_n tj |x|_|_ ||_g|_|jr|g|_nig|_|S)z8Initialize execution context for a DDLElement construct.Tr)__new__root_connection_dbapi_connectionrcompiledisddlexecution_options_execution_optionsdictrrr runicode_statementrGr create_cursorrcompiled_parametersr/rr)r^rrrr compiled_ddlrIrws rK _init_ddlz!DefaultExecutionContext._init_ddls({{3)!1!) #//  !)!;  ( I%)$*@%A%AD "  " ) )**G H H H2 O%)^H%=%=D "$--d.DEEaHDNN6:nX6N6N NDNT3((** #%   #&>>@@ADOO!dDO rMc ||}||_||_|j|_|_jsJj|j|_j j j f|_ tj|_js*|j|jj|_n |j|_j|_j|_j|_j|_|sg|_n8fdt7|D|_t9|dk|_||_|js|js|jrKd|_ tCjj"|_#tCj$o jj" |_%|jj&s |jj'r0|jr|(n|)j* j+r&tY  |- }nj.r |jj/}g}j.r|jD]{ g}|D]L} | vr+|0 |  | 1|0 | M|01||ncj } |jD]S | rtY  fd D}ntY fd D}|0|T1||_2|S)z6Initialize execution context for a Compiled construct.cDg|]\}}||S)) _group_number)construct_params)rgrpmrws rK z:DefaultExecutionContext._init_compiled...s@(((C))!3)??(((rMrTc3K|]B}|d|vr||n|fVCdS)rNrG)rkeycompiled_paramsrr s rK z9DefaultExecutionContext._init_compiled.._s!! $,,S11!4"j00,JsOOC,@AAA!0!5 !!!!!!rMc3bK|])}||vr||n|fV*dSrOr!)rrrr s rKrz9DefaultExecutionContext._init_compiled..isl!!  "j00,JsOOC,@AAA!0!5 !!!!!!rM)3rtrurvrrw can_executeryunionrz_result_columns_ordered_columns_textual_ordered_columnsresult_column_structr rr|rr(r.risinsertisupdateisdelete isplaintextis_textrr~ enumeraterrr}ris_crudbool _returning_is_explicit_returning returning_is_implicit_returninginsert_prefetchupdate_prefetch_process_executemany_defaults_process_executesingle_defaults_bind_processorscontains_expanding_parametersr{_expand_in_parametersr/ positiontuprrr) r^rrrrrwrrIrparamrr(rr s ` ` @@rK_init_compiledz&DefaultExecutionContext._init_compileds {{3)!1!)   ####!)!;!A!A  )" "   $  %  -% ! "&!9!92 4!3:: %DNN"3DN )  )  ) +  3(0(A(A(C(C'DD $ $((((' 33(((D $ #:2D ((** = DM T] DL*.x/A/L*M*MD '*."H8+=+H'H++D ' = ( 7DM,I 7 722444444666.  1 4j))J44XzJJKK   4-3K   " )#'#; J J&;;Cj(( _Z__S5I%J%JKKKK _S%9::::!!'"A"A%"H"HIIII J!<.sh<<< 0=,5mQ,G,G<<!)5,044AA6><<<<rMrzVALUES , c3K|];\ddfdtDzV..ss((%-Au !% :$*I()C ,>,>(>(B-&&'-)#"!"((((((rMN)rdr)rrrrIrs @@rKrz@DefaultExecutionContext._expand_in_parameters..s & &!1=#"ii(((((((1:-0H0H(((  & & & & & &rMc(g|]\}}d||fS)rr!)rrr_r-s rKrzADefaultExecutionContext._expand_in_parameters..s=<<< (5)-aa0%8<<<rMc3@K|]\}}jjd|izVdS)r-N)rwr)rrr_rIs rKrz@DefaultExecutionContext._expand_in_parameters..sQBB *U!M6&#FBBBBBBrMc3:K|]\}}v |fVdSrOr!)rrr_r-r s rKrz@DefaultExecutionContext._expand_in_parameters..sH"""Uz))*T*+))))""rMc3 K|] \}}|V dSrOr!)rr-r_s rKrz@DefaultExecutionContext._expand_in_parameters..s&&I&I et&I&I&I&I&I&IrMcg|]\}}|Sr!r!)r expand_keyr_s rKrzADefaultExecutionContext._expand_in_parameters..s)333#4:uJ333rMc:|dS)Nr)group)rreplacement_expressionss rKprocess_expandingzHDefaultExecutionContext._expand_in_parameters..process_expandings*1771::6 6rMz\[EXPANDING_(\S+)\])rr InvalidRequestErrorrwr/_numeric_bindsrn_expanded_parametersr~rbinds expandingpopvisit_empty_set_expr_expanding_in_typestyperr8listrrrBrdrextendrresubr) rIrwr rrto_update_sets parametervaluesrr-rrs ` ` @@@rKrz-DefaultExecutionContext._expand_in_parametersys   )L  = #  (D %5  %'!215   KKK"$" %DM % %$H )H )D  +D1I"B )222 .t 4II-0066F!';== N4$8!M>>(<2I99"+.!10 $F1It}==<<<<4=fa4H4H<<< N4$8 *.)EMII2 II & & & & &5>f4E4E & & &  9/55 <<<<,5fa,@,@<<< N4$89= BBBB.7BBB99/5  &&y111! !"""""&/""" &J&&&I&Iy&I&I&IIII338A333)$//$ )""4((( 7 7 7 7 7 "$5t~  rMc||}||_||_|j|_d|_|j|_|s0|jjrg|_ nig|_ nwt|djr||_ nTt|dtr&j r||_ n*fd|Dpig|_ nfd|D|_ t|dk|_j sBt|tjr(||_|d|_n|x|_|_||_|S)z8Initialize execution context for a string SQL statement.Trc0g|]fdDS)cTi|]$}|d|%S)rr)rkdrs rK zFDefaultExecutionContext._init_statement...s2===aW%%a((+QqT===rMr!)rrrs @rKrz;DefaultExecutionContext._init_statement..sA###>====1===###rMc:g|]}|Sr!)r)rprs rKrz;DefaultExecutionContext._init_statement..s478//22rMr)rtrurvrrrzryr/rrrr{rrrr rr|rGrr}r)r^rrrrrrrIs ` rK_init_statementz'DefaultExecutionContext._init_statements {{3)!1!)  ",!> |& '#*#B#B#D#D"E#%$  1 w'F G G (DOO  1 t , , 2 ",####'####T ((**  rMc|jr |jjSd|jvr*|jj|jdS|jjS)Nr)rwr5ryrr6_with_schema_translaterRs rKr6z+DefaultExecutionContext.identifier_preparer#s[ = 4=) ) #t'= = =<3JJ&'=> <3 3rMc|jjSrO)rurrRs rKrzDefaultExecutionContext.engine.s#**rMc|jjSrO)rw postfetchrRs rKpostfetch_colsz&DefaultExecutionContext.postfetch_cols2s }&&rMcR|jr |jjS|jr |jjSdS)Nr!)rrwrrrrRs rK prefetch_colsz%DefaultExecutionContext.prefetch_cols6s1 = =0 0 ] =0 02rMc|jjdSrO)rwrrRs rKreturning_colsz&DefaultExecutionContext.returning_cols?s rMc8|jddS)N no_parametersF)rygetrRs rKrz%DefaultExecutionContext.no_parametersCs%))/5AAArMc|jd|j r|jr tjpd}|tjur||jS|S)N autocommitF)ryrrwrrPARSE_AUTOCOMMITshould_autocommit_textr|)rIrs rKshould_autocommitz)DefaultExecutionContext.should_autocommitGsq+//   , ,+     4 4 4..t/EFF F rMc|j}t|tjr,|jjs |j|d}|jjr|j}ni}| |j ||||j d}|>| |j|j j dd}|r ||S|S)aExecute a string statement on the current cursor, returning a scalar result. Used to fire off sequences, default phrases, and "select lastrowid" types of statements individually or in the context of a parent INSERT or UPDATE statement. r)rNr)rurr rrrrGr/rrrr_cached_result_processorr)rIstmttype_rdefault_paramsrprocs rK_execute_scalarz'DefaultExecutionContext._execute_scalarVs# tT^ , , 2L< 2<((..q1D < " !\AACCNNN T[$MMM K " "1 %  11 dk5a8;D tAwwrMc4|jSrO)ru_branchrRs rKrrz"DefaultExecutionContext.connectionws#++---rMc6t|SrO)AUTOCOMMIT_REGEXPmatch)rIrs rKrz.DefaultExecutionContext.should_autocommit_text{s &&y111rMc|jjsdS|jjr|jddo||jr$t |jjtj pQ|j p#t |jjtj o%|jot |j}n|jdd}|S)NFstream_resultsT) rrQserver_side_cursorsryrrwrrr Selectable TextClauseSERVER_SIDE_CURSOR_REr)rIuse_server_sides rK_use_server_side_cursorz/DefaultExecutionContext._use_server_side_cursor~s|8 5 < + "488 $M" /1F  !% -) $ 79N  H !N H277GG! O*#488 %OrMc|rd|_|Sd|_|jSr)r_is_server_sidecreate_server_side_cursorrvrrRs rKr}z%DefaultExecutionContext.create_cursorsM  ' ' ) ) 3#'D 1133 3#(D )0022 2rMctrO)rnrRs rKrz1DefaultExecutionContext.create_server_side_cursors!###rMcdSrOr!rRs rKpre_execz DefaultExecutionContext.pre_execrrMcdSrOr!rRs rK post_execz!DefaultExecutionContext.post_execrrMc8||j|S)zReturn a 'result processor' for a given type as present in cursor.description. This has a default implementation that dialects can override for context-sensitive result type handling. )rr)rIrcolnamecoltypes rKget_result_processorz,DefaultExecutionContext.get_result_processors--dlGDDDrMc|jjS)areturn self.cursor.lastrowid, or equivalent, after an INSERT. This may involve calling special cursor functions, issuing a new SELECT on the cursor (or a new one), or returning a stored value that was calculated within post_exec(). This function will only be called for dialects which support "implicit" primary key generation, keep preexecute_autoincrement_sequences set to False, and when no explicit id value was bound to the statement. The function is called once, directly after post_exec() and before the transaction is committed or ResultProxy is generated. If the post_exec() method assigns a value to `self._lastrowid`, the value is used in place of calling get_lastrowid(). Note that this method is *not* equivalent to the ``lastrowid`` method on ``ResultProxy``, which is a direct proxy to the DBAPI ``lastrowid`` accessor in all cases. )r lastrowidrRs rK get_lastrowidz%DefaultExecutionContext.get_lastrowids4{$$rMcdSrOr!)rIrs rKhandle_dbapi_exceptionz.DefaultExecutionContext.handle_dbapi_exceptionrrMc`|jrtj|Stj|SrO)rrBufferedRowResultProxy ResultProxyrRs rKget_result_proxyz(DefaultExecutionContext.get_result_proxys/   ,066 6%d++ +rMc|jjSrO)rrowcountrRs rKrz DefaultExecutionContext.rowcounts {##rMc|jjSrO)rrYrRs rKrYz.DefaultExecutionContext.supports_sane_rowcounts |22rMc|jjSrO)rrLrRs rKrLz4DefaultExecutionContext.supports_sane_multi_rowcounts |88rMct|jrV|jsO|js-|jjs!|jjr|n|js|| }|jrg|jrB|j }||_ | ||j d|_nv|js|j d|_nX|jr4|jr-|j }||_ |j d|_n|j|j|j |SrO)rrrrwinlinerr=_setup_ins_pk_from_lastrowid_setup_ins_pk_from_emptyrrreturned_defaults%_setup_ins_pk_from_implicit_returning _soft_close _metadatarrr)rIrrs rK_setup_crud_result_proxyz0DefaultExecutionContext._setup_crud_result_proxysr = 0!1 0/ 0 , 0L4 0 1133330 0--///&&(( = !* (%fo''),&::3???""$$$#'  0 (""$$$#' ] !t: !!&/##C%(D " F  #F     % OO F   rMcr|jjd|jjj}|jd|S|j-j|j d}| |fd|j D|_ dSfd|j D|_ dS)NrrcZg|]'}|urn|d(SrOr)rc autoinc_colr key_getterrs rKrzHDefaultExecutionContext._setup_ins_pk_from_lastrowid..sU))) ## $((A==)))rMcNg|]!}|d"SrOr&rr'rr)s rKrzHDefaultExecutionContext._setup_ins_pk_from_lastrowid..'sA))) ##JJqMM488)))rM) rw_key_getters_for_crud_columnrrr~r_autoincrement_columnrrr primary_keyinserted_primary_key)rIrrr(rr)rs @@@@rKrz4DefaultExecutionContext._setup_ins_pk_from_lastrowids]?B  '-215&&((  5K&"'@@L$# $YI)))))))* )))D % % %)))))*)))D % % %rMc|jjd|jjj}|jdfd|jD|_dS)NrrcNg|]!}|d"SrOr&r+s rKrzDDefaultExecutionContext._setup_ins_pk_from_empty..0s>% % % 9:O   1 t 4 4% % % rM)rwr,rrr~r.r/)rIrrr)s @@rKrz0DefaultExecutionContext._setup_ins_pk_from_empty,sf]?B  '-215% % % % % >C>O% % % !!!rMc d|_dS|jjd|jjj}|jdfdfd|jDD|_dS)Nrrc.g|]\}}||n|SrOr!)rcolr_rs rKrzQDefaultExecutionContext._setup_ins_pk_from_implicit_returning..<s9% % % U CHH5% % % rMcRg|]#}||df$SrOr&)rr4rr)s rKrzQDefaultExecutionContext._setup_ins_pk_from_implicit_returning..>sFo))**S//4@@ArM)r/rwr,rrr~r.)rIrrrr)s ` @@rKr z=DefaultExecutionContext._setup_ins_pk_from_implicit_returning4s ;(,D % F]?B  '-215% % % %  ,% % % !!!rMcP|js|jot|jjSrO)rrrrwrrRs rKlastrow_has_defaultsz,DefaultExecutionContext.lastrow_has_defaultsDs, . D M #5 5  rMcz t|jdsdSi}|jjD]p}|j|j}t|}||jj |r |vr||vr|r |vs||vr ||<kd||<q|jjr2|jj ||j |j |j ||jjrg}|jjD]|} |jj| }||d P| |jvr2| gt)|j| zg| } |j j|dS#t.$r)} |j| ddd|Yd} ~ dSd} ~ wwxYwi} |jjD]\}} ||d |r|| | } |jjs |j| d} | |jvr-|  fd|j| D | | < |j jdi| dS#t.$r)} |j| ddd|Yd} ~ dSd} ~ wwxYw)a&Given a cursor and ClauseParameters, call the appropriate style of ``setinputsizes()`` on the cursor, using DB-API types from the bind parameter's ``TypeEngine`` objects. This method only called by those dialects which require it, currently cx_oracle. bind_namesNrc3 K|]}|fV dSrOr!)rrdbtypes rKrz:DefaultExecutionContext.set_input_sizes..s<22 *(0222222rMr!)hasattrrwr9r_unwrapped_dialect_implrget_dbapi_typer1 _has_eventsdispatchdo_setinputsizesrrrr/rrrrrrr setinputsizes BaseExceptionru_handle_dbapi_exceptionitemsr'rGr) rI translate include_types exclude_types inputsizes bindparam dialect_impldialect_impl_clspositional_inputsizesrrkeyword_inputsizesr;s @rKset_input_sizesz'DefaultExecutionContext.set_input_sizesIst}l33  F 1 - -I$>AA$,OOL#L11 !001CDDF"%#]22( ==&>..'=88)/ 9%%(, 9%% < #  L ! 2 2DK$    < "* $& !}0 = = M/4 # 488%d777-44#Hs4+DS+I'J'JJ.44V<<< ) )+@AAAA    $<<tT4  "$ "&-":"@"@"B"B 9 9 3# 488% 6(mmC55<><"l33C88;d777*112222.2.G.L222 39*3/ ) )??,>?????    $<<tT4 s0.E?? F2 F--F23J J:J55J:c|jr|||S|jr||_||S|jr|j}|jstj |j|}n|j}tj |g |}| |di S|jS)N)bindr!) is_sequence fire_sequence is_callablecurrent_columnargis_clause_elementrr _arg_is_typedr type_coercerr_execute_compiledscalar)rIcolumnrrr default_argr's rK _exec_defaultz%DefaultExecutionContext._exec_defaults   %%gu55 5   "(D ;;t$$ $  & ?D( *(4W[%HH %k !;-0088d8CCA))!R44;;== =; rMTc |j|j}n"#t$rtjdwxYw|r|jr|jjjr|j r$|j dz|j j |j i}n|j |j i}d|jjj d}|fd|D|SS)aiReturn a dictionary of parameters applied to the current row. This method can only be used in the context of a user-defined default generation function, e.g. as described at :ref:`context_default_functions`. When invoked, a dictionary is returned which includes entries for each column/value pair that is part of the INSERT or UPDATE statement. The keys of the dictionary will be the key value of each :class:`_schema.Column`, which is usually synonymous with the name. :param isolate_multiinsert_groups=True: indicates that multi-valued INSERT constructs created using :meth:`_expression.Insert.values` should be handled by returning only the subset of parameters that are local to the current column default invocation. When ``False``, the raw parameters of the statement are returned including the naming convention used in the case of multi-valued INSERT. .. versionadded:: 1.2 added :meth:`.DefaultExecutionContext.get_current_parameters` which provides more functionality over the existing :attr:`.DefaultExecutionContext.current_parameters` attribute. .. seealso:: :attr:`.DefaultExecutionContext.current_parameters` :ref:`context_default_functions` zdget_current_parameters() can only be invoked in the context of a Python side column default functionrrc36K|]}|d|fzfVdS)z%s_m%dNr!)rrindexrs rKrzADefaultExecutionContext.get_current_parameters..sG?BjS%L!89:rM)current_parametersrUAttributeErrorr rrrwr_has_multi_parameters_is_multiparam_columnraoriginalrrkeysr)rIisolate_multiinsert_groupsr\rrgrars @@rKget_current_parametersz.DefaultExecutionContext.get_current_parameterss-B 0J(FF   )C   '    '=  +  q(_(*VZ*@AZFJ!78=*5a8==??D HHFJ   H s2cV|jdS|||j|jSrO)rr^rrIr\s rKget_insert_defaultz*DefaultExecutionContext.get_insert_default s+ > !4%%ffnfkJJ JrMcV|jdS|||j|jSrO)onupdater^rrks rKget_update_defaultz*DefaultExecutionContext.get_update_defaults+ ? "4%%ffov{KK KrMc|jjd}i}|jj}|jj}|D]$}|jr|jjr|jj||<%|D]$}|jr|jjr|jj||<%|jD]w}||_ |D]4}||vr ||}n| |}|||||<5|D]4}||vr ||}n| |}|||||<5x|` dS)Nr) rwr,rrr is_scalarrVrnr~rbrlro)rIr)scalar_defaultsrrr'rvals rKrz5DefaultExecutionContext._process_executemany_defaultssc]?B -7-7 ! 3 3Ay 3QY0 3%&Y]"  4 4Az 4aj2 4%&Z^"- / /E&+D #$ / /'')!,CC11!44C?+.E**Q--($ / /'')!,CC11!44C?+.E**Q--(  /  # # #rMc~|jjd}|jdx|_}|jjD]S}|jr%|jjs|jjr |jj}n| |}|||||<T|jj D]'}| |}|||||<(|`dS)Nrr) rwr,r~rbrrrRrqrVrlrro)rIr)r~r'rss rKrz7DefaultExecutionContext._process_executesingle_defaults:s]?B   $Q ' ( . 9 9Ay 1!6 119;N 1im--a0058#JJqMM2. 9 9A))!,,C58#JJqMM2  # # #rM)NNN)T)?r+rer,rrrrrrxrrwrrrrr_translate_colnamer rCrrZrrrrrrXr6rrrrrrrrYrrrrr}rrr r rrrrrYrLr#rrr r7rOr^rbrirlrorrr!rMrKrrrrsHHHGG EKHI""-4-//[@ss[sjlll\--[-^  [  444 +++ '''      BBB    B..X.222@333$$$      EEE%%%8   ,,, $$X$333999%%%N:         AEVVVVp&0::::xKKK LLL #$#$#$J$$$$$rMrr))r-rErrrPrrrrrr r r r rr sqlrrr sql.elementsrrIUNICODErrDialectrobjectr\rnrcrorgrprirkExecutionContextrrexecution_ctx_clsr!rMrKr~s  &&&&&&BJ4bdRZ6G # < 1BCCs s s s s Z's s s lf     ?H$5                     .A$A$A$A$A$j9A$A$A$H$; rM