B 4]@sdZddlZddlZddlZddlZddlmZddlmZddlmZddlm Z dd lm Z dd lm Z dd lm Z dd lm Zdd lmZddlmZddlmZddlmZedejejBZedejejBZGdddejZGdddeZGdddejZee_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)schemaz-\s*(?:UPDATE|INSERT|CREATE|DELETE|DROP|ALTER)z \s*SELECTc @sneZdZdZejZejZej Z ej Z dZ dZdZdZeZdZdZdZdZdZdZdZdZdZdZdZdZdZe !de "dfde j#fde "d fd e "d fd e j#fd e j#fd e j#fde j$fgZ%dZ&e j'rdZ(dZ)dZ*dZ+ndZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0iZ1dZ2dZ3dZ4dZ5dZ6dZ7dZ8dZ9dZ:e !Z;e jddZ?e@ddZAe@dd ZBeCd!d"ZDd#d$ZEd%d&ZFd\d'd(ZGd)d*ZHd+d,ZId-d.ZJd]d/d0ZKd1d2ZLd3d4ZMd5d6ZNd7d8ZOd9d:ZPd;d<ZQd=d>ZRd?d@ZSdAdBZTdCdDZUe j>dEdFZVdGdHZWdIdJZXdKdLZYdMdNZZdOdPZ[d^dQdRZ\d_dSdTZ]d`dUdVZ^dWdXZ_dYdZZ`dS)aDefaultDialectz!Default implementation of DialectTFrconvert_unicodeforceZ pool_timeoutZechodebugZ echo_poolZ pool_recycleZ pool_sizeZ max_overflowZpool_threadlocalN use_encodingdefaulti'Znamed)z1.3zThe :paramref:`.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 Ksvt|ddstd|j||_||_d|_d|_||_|dk rJ||_ n|jdk r`|jj |_ n|j |_ |dk rv||_ |j dk|_| ||_ |||_|dk r||_|dk r||_||_| |_| dkrd|_n$| dkrd|_| dk|_n td | r| |jkrtd | |jf| |_|jd kr.check_unicodez'test plain returns'<z'test unicode returns'csh|] }|qSrr).0rQ)rVrr3 {sz8DefaultDialect._check_unicode_returns..TFZ conditional)r py2ksupports_unicode_statements binary_typerPrexecute_sequence_formatrcastliteral_columnsqltypesZVARCHARZUnicode issuperset)r1rAZadditional_testsZtestsresultsr)rTrVrArUr1r3rCKs&   z%DefaultDialect._check_unicode_returnscCsttjr|jstj}ntj}|j}z@||t t d dgj |dt |jddtjS|XdS)Nz'x'Z some_label)rHr)r rZr[r\rPrArKexecuterrIr_ZlabelrJrO descriptionrN)r1rArTrKrrr3rEs   z)DefaultDialect._check_unicode_descriptioncCst||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`Z adapt_typecolspecs)r1Ztypeobjrrr3type_descriptors zDefaultDialect.type_descriptorcKs tj|}|j||||f|S)N)rZ InspectorZ from_engine reflecttable)r1rAtableZinclude_columnsZexclude_columnsZ resolve_fksoptsZinsprrr3rgs zDefaultDialect.reflecttablecKsd|j||fd|i|iS)zCompatibility method, adapts the result of get_primary_keys() for those dialects which don't implement get_pk_constraint(). Zconstrained_columnsr)Zget_primary_keys)r1connZ table_namerkwrrr3get_pk_constraintsz DefaultDialect.get_pk_constraintcCs&t||jkr"td||jfdS)Nz7Identifier '%s' exceeds maximum length of %d characters)lenr*rZIdentifierError)r1Zidentrrr3validate_identifiersz"DefaultDialect.validate_identifiercOs|jj||S)N)r connect)r1ZcargsZcparamsrrr3roszDefaultDialect.connectcCs|}||jg|gS)N)Ztranslate_connect_argsupdateZquery)r1r=rirrr3create_connect_argss z"DefaultDialect.create_connect_argscsbd|kr*|dt|dfdd}d|kr^t|d|_t|dfdd}dS)Nisolation_levelZengine_connectcs|s|dS)N)_set_connection_isolation)rAbranch)rrr1rr3 set_isolationszBDefaultDialect.set_engine_execution_options..set_isolationschema_translate_mapcs |_dS)N)schema_for_object)rArt)getterrr3set_schema_translate_mapszMDefaultDialect.set_engine_execution_options..set_schema_translate_map)rZ listens_forr_schema_getterrw)r1engineriruryr)rxrrr1r3set_engine_execution_optionssz+DefaultDialect.set_engine_execution_optionscCs8d|kr|||dd|kr4t|d}||_dS)Nrrrv)rsrrzrw)r1rArirxrrr3 set_connection_execution_optionss z/DefaultDialect.set_connection_execution_optionscCs6|rtd||j||jjj|jdS)NzConnection is already established with a Transaction; setting isolation_level may implicitly rollback or commit the existing transaction, or have no effect until next transaction) Zin_transactionr rset_isolation_levelrAZ_connection_recordZfinalize_callbackappendreset_isolation_level)r1rAlevelrrr3rss  z(DefaultDialect._set_connection_isolationcCsdS)Nr)r1dbapi_connectionrrr3do_beginszDefaultDialect.do_begincCs |dS)N)Zrollback)r1rrrr3 do_rollbackszDefaultDialect.do_rollbackcCs |dS)N)Zcommit)r1rrrr3 do_commitszDefaultDialect.do_commitcCs |dS)N)rN)r1rrrr3do_closeszDefaultDialect.do_closecCsttdgj|dS)Nr)rH)strrrIrJ)r1rrr3_dialect_specific_select_onesz+DefaultDialect._dialect_specific_select_onec Cspd}y(|}z||jWd|XWn:|jjk rf}z||||rTdSWdd}~XYnXdSdS)NFT)rKrcrrNr Error is_disconnect)r1rrKerrrrr3do_pingszDefaultDialect.do_pingcCsdtdddS)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)randomZrandint)r1rrr3 create_xidszDefaultDialect.create_xidcCs|t|dS)N)rcrZSavepointClause)r1rArrrr3 do_savepointszDefaultDialect.do_savepointcCs|t|dS)N)rcrZRollbackToSavepointClause)r1rArrrr3do_rollback_to_savepointsz'DefaultDialect.do_rollback_to_savepointcCs|t|dS)N)rcrZReleaseSavepointClause)r1rArrrr3do_release_savepoint!sz#DefaultDialect.do_release_savepointcCs|||dS)N) executemany)r1rKrRrUcontextrrr3do_executemany$szDefaultDialect.do_executemanycCs|||dS)N)rc)r1rKrRrUrrrr3 do_execute'szDefaultDialect.do_executecCs||dS)N)rc)r1rKrRrrrr3do_execute_no_params*sz#DefaultDialect.do_execute_no_paramscCsdS)NFr)r1erArKrrr3r-szDefaultDialect.is_disconnectcCs|||jdS)N)r~rB)r1Z dbapi_connrrr3r0sz$DefaultDialect.reset_isolation_level) FrNNNNTNrN)N)N)N)N)N)a__name__ __module__ __qualname____doc__r Z SQLCompilerstatement_compiler DDLCompiler ddl_compilerZGenericTypeCompilerr%IdentifierPreparerr$Zsupports_alterZsupports_commentsZinline_commentsZdefault_sequence_basetupler]Zsupports_viewssupports_sequencessequences_optional"preexecute_autoincrement_sequencespostfetch_lastrowidr#r&Zcte_follows_insertZsupports_native_enumr'Z#non_native_boolean_check_constraintsupports_simple_order_by_labeltuple_in_valuesr immutabledictZ bool_or_strZasintZasboolZengine_config_typesZsupports_native_decimalZpy3kr[supports_unicode_bindsrDr,rr*Zmax_index_name_lengthr:supports_sane_multi_rowcountrer"Zsupports_default_valuesZsupports_empty_insertZsupports_multivalues_insertsupports_server_side_cursorsr?Zconstruct_argumentsZrequires_name_normalizeZreflection_optionsZdbapi_exception_translation_mapZdeprecated_paramsr4memoized_propertyr7propertyr9r; classmethodr>rFrGrCrErfrgrlrnrorqr|r}rsrrrrrrrrrrrrrrrrrrr3r+s   *   ?    7       rc@s<eZdZejZejZejZ ej Z dZ dZ dZdZdZdZdS)StrCompileDialectTFN)rrrr ZStrSQLCompilerrrrZStrSQLTypeCompilerr%rr$rrrr#r'rrrrr3r7src@seZdZdZdZdZdZdZdZdZ dZ dZ dZ dZ dZdZdZeZeddZeddZddZed d Zed d Zejd dZejddZejddZejddZejddZejddZ ddZ!e"ddZ#ddZ$dd Z%d!d"Z&d#d$Z'd%d&Z(d'd(Z)d)d*Z*d+d,Z+d-d.Z,d/d0Z-e"d1d2Z.d3d4Z/d5d6Z0d7d8Z1d9d:Z2d;d<Z3d=d>Z4d?d@Z5dPdAdBZ6dCdDZ7dZ8dQdFdGZ9dHdIZ:dJdKZ;dLdMZ|D]6} | kr|.| | n|.| qW|./|qWn^j } xT|jD]J| rt0fddD}nt0fddD}|.|qW/||_1|S)z6Initialize execution context for a Compiled construct.csg|]\}}j||dqS))Z _group_number)construct_params)rXZgrpm)rrr3 sz:DefaultExecutionContext._init_compiled..rTc3s<|]4}|d|kr*||n|fVqdS)rN)r0)rXkey)compiled_paramsrHr rr3 sz9DefaultExecutionContext._init_compiled..c3s2|]*}||kr ||n|fVqdS)Nr)rXr)rr rr3rs)2rrrrHrrunionrZ_result_columnsZ_ordered_columnsZ_textual_ordered_columnsresult_column_structr rPrr[encoderrRisinsertisupdateisdeleteZ isplaintextis_textrr enumeratermrrrKis_crudboolZ _returning_is_explicit_returning returning_is_implicit_returninginsert_prefetchupdate_prefetch_process_executemany_defaults_process_executesingle_defaultsZ_bind_processorsZcontains_expanding_parameters_expand_in_parametersr positiontuprr]rrU) r<rHrArrrUr1rparamrrr)rrrHr r3_init_compiled~sx               z&DefaultExecutionContext._init_compiledc sjrtdjjr(jjr(tdi_jd}|jrDg}nd}ii}x|jrbjj njj D]rjj }|j rΈkr|n| }|sg|<j |jr|jn|jg<nt|dttfr<fddt|dD|<jjrdnd d fd d t|D<n<fd dt|dD|<d fdd D<|fdd D|jr|dd DddDj<qj|jrj|qjWfdd}td|j_|S)zhandle special 'expanding' parameters, IN tuples that are rendered on a per-parameter basis for an otherwise fixed SQL statement string. z7'expanding' parameters can't be used with executemany()zQ'expanding' bind parameters not supported with 'numeric' paramstyle at this time.rNcs6g|].\}}t|dD]\}}d||f|fqqS)rz%s_%s_%s)r)rXi tuple_elementjvalue)rrr3r-szADefaultExecutionContext._expand_in_parameters..rzVALUES z, c3s8|]0\ddfddtDVqdS)z(%s)z, c3s6|].\}}jjdt|diVqdS)rrN)r bindtemplaterm)rXrr)rr1 to_updaterrr3r6szJDefaultExecutionContext._expand_in_parameters...N)joinr)rX)r1r)rrr3r4s z@DefaultExecutionContext._expand_in_parameters..cs g|]\}}d|f|fqS)z%s_%sr)rXrr)rrr3rBsc3s"|]\}}jjd|iVqdS)rN)rr)rXrr)r1rr3rFsc3s&|]\}}kr|fVqdS)Nr)rXrr)rr rr3rLscss|]\}}|VqdS)Nr)rXrrrrr3rQscSsg|] \}}|qSrr)rX expand_keyrrrr3rSscs|dS)Nr)group)r)replacement_expressionsrr3process_expandingXszHDefaultExecutionContext._expand_in_parameters..process_expandingz\[EXPANDING_(\S+)\])rrInvalidRequestErrorrrZ_numeric_bindsr@_expanded_parametersrrbindsZ expandingpopZvisit_empty_set_exprZ_expanding_in_typestyperOrlistrrHrrrpextendrresubrR) r1rr rrZto_update_setsZ parametervaluesrr)rr rr1rr3rsf              z-DefaultExecutionContext._expand_in_parameterscs||}||_||_|j|_d|_|j|_|sP|jjrFg|_ qig|_ ndt |djrh||_ nLt |dt rj r||_ qfdd|Dpig|_ nfdd|D|_ t |dk|_j st |tjr||_|d|_n ||_|_||_|S)z8Initialize execution context for a string SQL statement.Trcs g|]fddDqS)cs i|]}||dqS)r)r0)rXk)drHrr3 {szFDefaultExecutionContext._init_statement...r)rX)rH)rr3r{sz;DefaultExecutionContext._init_statement..csg|]}|qSr)r])rXp)rHrr3rsr)rrrrHrrrrr]rUrOrr[rmrr rPrr0rRrrK)r<rHrArrRrUr1r)rHr3_init_statement`s6       z'DefaultExecutionContext._init_statementcCs4||}||_||_|j|_|j|_||_|S)z;Initialize execution context for a ColumnDefault construct.)rrrrHrrrrK)r<rHrArr1rrr3 _init_defaults  z%DefaultExecutionContext._init_defaultcCs|jjS)N)rr{)r1rrr3r{szDefaultExecutionContext.enginecCs|jjS)N)r postfetch)r1rrr3postfetch_colssz&DefaultExecutionContext.postfetch_colscCs$|jr|jjS|jr|jjSdSdS)Nr)rrrrr)r1rrr3 prefetch_colss z%DefaultExecutionContext.prefetch_colscCs |jjdS)N)rr)r1rrr3returning_colssz&DefaultExecutionContext.returning_colscCs|jddS)N no_parametersF)rget)r1rrr3rsz%DefaultExecutionContext.no_parameterscCs@|jd|j r|jrtjpd}|tjkr8||jS|SdS)N autocommitF)rrrrRrZPARSE_AUTOCOMMITshould_autocommit_textr)r1rrrr3should_autocommits  z)DefaultExecutionContext.should_autocommitcCs|j}t|tjr*|jjs*|j|d}|jjr>|j}ni}|j |j |||d|j d}|dk r| |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)rrOr rPrHr[r0rr]rLrKrM_cached_result_processorrd)r1Zstmttype_rjZdefault_paramsrprocrrr3_execute_scalars   z'DefaultExecutionContext._execute_scalarcCs |jS)N)rZ_branch)r1rrr3rAsz"DefaultExecutionContext.connectioncCs t|S)N)AUTOCOMMIT_REGEXPmatch)r1rRrrr3rsz.DefaultExecutionContext.should_autocommit_textcCsv|jjs dS|jjrd|jddo`|jr8t|jjtj p`|j sPt|jjtj o`|jo`t |j}n|jdd}|S)NFZstream_resultsT) rHrZserver_side_cursorsrrrrOrRrZ SelectableZ TextClauseSERVER_SIDE_CURSOR_REr)r1Zuse_server_siderrr3_use_server_side_cursors z/DefaultExecutionContext._use_server_side_cursorcCs*|rd|_|Sd|_|jSdS)NTF)r_is_server_sidecreate_server_side_cursorrrK)r1rrr3r s z%DefaultExecutionContext.create_cursorcCs tdS)N)r@)r1rrr3rsz1DefaultExecutionContext.create_server_side_cursorcCsdS)Nr)r1rrr3pre_execsz DefaultExecutionContext.pre_execcCsdS)Nr)r1rrr3 post_execsz!DefaultExecutionContext.post_execcCs||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. )rrH)r1rZcolnameZcoltyperrr3get_result_processorsz,DefaultExecutionContext.get_result_processorcCs|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. )rK lastrowid)r1rrr3 get_lastrowid'sz%DefaultExecutionContext.get_lastrowidcCsdS)Nr)r1rrrr3handle_dbapi_exceptionCsz.DefaultExecutionContext.handle_dbapi_exceptioncCs|jrt|St|SdS)N)rrZBufferedRowResultProxyZ ResultProxy)r1rrr3get_result_proxyFs z(DefaultExecutionContext.get_result_proxycCs|jjS)N)rKrowcount)r1rrr3rLsz DefaultExecutionContext.rowcountcCs|jjS)N)rHr:)r1rrr3r:Psz.DefaultExecutionContext.supports_sane_rowcountcCs|jjS)N)rHr)r1rrr3rSsz4DefaultExecutionContext.supports_sane_multi_rowcountcCs|jr:|js:|js,|jjs,|jjr,|n|js:|| }|jr|jrv| }||_ | || d|_q|js| d|_nB|jr|jr| }||_ | d|_n|jdkr|j| |S)N)rrrrZinlinerHr_setup_ins_pk_from_lastrowid_setup_ins_pk_from_emptyrrMreturned_defaults%_setup_ins_pk_from_implicit_returningZ _soft_closeZ _metadatarrr)r1rrSrrr3_setup_crud_result_proxyVs6     z0DefaultExecutionContext._setup_crud_result_proxycs|jjd|jjj}|jd|dk r||jdk r^j|j d}|dk r^|fdd|j D|_ nfdd|j D|_ dS)Nrrcs(g|] }|krn|dqS)N)r)rXc) autoinc_colr key_getterr rr3rszHDefaultExecutionContext._setup_ins_pk_from_lastrowid..csg|]}|dqS)N)r)rXr)rrrr3rs) r_key_getters_for_crud_columnrRrhrr Z_autoincrement_columnrrrH primary_keyinserted_primary_key)r1rhrr)rrrr r3r}s     z4DefaultExecutionContext._setup_ins_pk_from_lastrowidcs<|jjd|jjj}|jdfdd|jD|_dS)Nrrcsg|]}|dqS)N)r)rXr)rrrr3rszDDefaultExecutionContext._setup_ins_pk_from_empty..)rrrRrhrrr)r1rhr)rrr3rs   z0DefaultExecutionContext._setup_ins_pk_from_emptycs\dkrd|_dS|jjd|jjj}|jdfddfdd|jDD|_dS)Nrrcs$g|]\}}|dkr|n|qS)Nr)rXcolr)rSrr3rszQDefaultExecutionContext._setup_ins_pk_from_implicit_returning..cs g|]}||dfqS)N)r)rXr)rrrr3rs)rrrrRrhrr)r1rSrhr)rrrSr3rs     z=DefaultExecutionContext._setup_ins_pk_from_implicit_returningcCs|js |jot|jjS)N)rrrrr)r1rrr3lastrow_has_defaultssz,DefaultExecutionContext.lastrow_has_defaultsc sTt|jdsdSi}xv|jjD]j}|j|j}t|}||jjdk r|rb|kr||kr|rv|ksv||kr||<qd||<qW|jjr|jj ||j |j |j ||jjrng}xb|jjD]V} |jj| }||ddk r| |jkr|gt|j| q|qWy|j j|Wn8tk rj} z|j| ddd|Wdd} ~ XYnXni} x|jjD]\}} ||ddk r|r|| | } |jjs|j| d} | |jkr| fdd|j| Dn| | <qWy|j jf| Wn8tk rN} z|j| ddd|Wdd} ~ XYnXdS)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_namesNrc3s|]}|fVqdS)Nr)rXr)dbtyperr3rsz:DefaultExecutionContext.set_input_sizes..)hasattrrrrZ_unwrapped_dialect_implrHZget_dbapi_typer Z _has_eventsdispatchZdo_setinputsizesrKrRrUrrrrrrrmrZ setinputsizes BaseExceptionrZ_handle_dbapi_exceptionitemsrr0rp) r1 translateZ include_typesZ exclude_typesZ inputsizesZ bindparamZ dialect_implZdialect_impl_clsZpositional_inputsizesrrZkeyword_inputsizesr)rr3set_input_sizessh       "      z'DefaultExecutionContext.set_input_sizescCs|jr|||S|jr(||_||S|jrv|j}|jsJt |j|}n|j}t |gj |d}| |di S|jSdS)N)Zbindr) is_sequenceZ fire_sequenceZ is_callablecurrent_columnargZis_clause_elementrAZ _arg_is_typedrZ type_coercerIrJZ_execute_compiledZscalar)r1columnrrrjZ default_argrrrr3 _exec_defaults  z%DefaultExecutionContext._exec_defaultTcsy|j|j}Wntk r.tdYnX|r|jr|jjjr|j rh|j d|j j |j i}n|j |j i}d|jjj d}|fdd|D|SSdS)aFReturn 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:`.Column`, which is usually synonymous with the name. :param isolate_multiinsert_groups=True: indicates that multi-valued INSERT constructs created using :meth:`.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 functionrrc3s"|]}|d|ffVqdS)z%s_m%dNr)rXr)indexrUrr3rnszADefaultExecutionContext.get_current_parameters..N)current_parametersr&AttributeErrorrrrrrRZ_has_multi_parametersZ_is_multiparam_columnr*ZoriginalrrUkeysrp)r1Zisolate_multiinsert_groupsr(rr-r)r*rUr3get_current_parameters:s&    z.DefaultExecutionContext.get_current_parameterscCs$|jdkrdS|||j|jSdS)N)rr)r)r1r(rrr3get_insert_defaultts z*DefaultExecutionContext.get_insert_defaultcCs$|jdkrdS|||j|jSdS)N)onupdater)r)r1r(rrr3get_update_defaultzs z*DefaultExecutionContext.get_update_defaultcCs |jjd}i}|jj}|jj}x&|D]}|jr&|jjr&|jj||<q&Wx&|D]}|jrN|jjrN|jj||<qNWx|jD]}||_ x<|D]4}||kr||}n | |}|dk r||||<qWx<|D]4}||kr||}n | |}|dk r||||<qWqxW|` dS)Nr) rrrrr is_scalarr'r0rr+r/r1)r1rZscalar_defaultsrrrrvalrrr3rs2          z5DefaultExecutionContext._process_executemany_defaultscCs|jjd}|jd|_}xN|jjD]B}|jrJ|jjsJ|jjrJ|jj}n | |}|dk r&||||<q&Wx.|jj D]"}| |}|dk rv||||<qvW|`dS)Nrr) rrrr+rrr%r2r'r/rr1)r1rrrr3rrr3rs    z7DefaultExecutionContext._process_executesingle_defaults)NNN)T)>rrrrrrrrrrrrRrrrrZ_translate_colnamer rrrrrrrrrr{rrrrrrrrArrrrrr r r r rrr:rrrrrrr$r)r+r.r/r1rrrrrr3rHsl ! tn 0  !    ' W :%r)rr.rrr5rrrrrrr r r r`r Zsqlr rrrJIUNICODErrZDialectrrZExecutionContextrZexecution_ctx_clsrrrr3sB            z