Files
aitsc/.venv/Lib/site-packages/sqlalchemy/engine/__pycache__/base.cpython-312.pyc

1490 lines
127 KiB
Plaintext
Raw Normal View History

2025-02-23 09:07:52 +08:00
<EFBFBD>
2025-08-16 19:28:45 +08:00
<00><18>h@<40><00><01><><00>UdZddlmZddlZddlZddlZddlmZddlmZddlmZddlm Z ddlm
2025-02-23 09:07:52 +08:00
Z
dd lm Z dd
lm Z dd lm Z dd lmZdd lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddl m!Z!ddl m"Z"dd l m#Z#dd!l mZdd"l$m%Z%dd!l$mZ&ejNr<>dd#l m(Z(dd$l m)Z)dd%lm*Z*dd&lm+Z+dd'lm,Z,dd(lm-Z-dd)lm.Z.dd*lm/Z/dd+lm0Z0dd,lm1Z1dd-lm2Z2dd.lm3Z3dd/lm4Z4dd0lm5Z5dd1l6m7Z7dd2l8m9Z9dd3l:m;Z;dd4l#m<Z<dd5l=m>Z>dd6l=m?Z?dd7l=m@Z@dd8l$mAZAdd9lBmCZCdd:lDmEZEdd;lFmGZGdd<lFmHZHdd=lFmIZIdd>lJmKZKdd?lLmMZMdd@lLmNZNddAlLmOZOddBlPmQZQedCe<06>D<EFBFBD>ZRej<>ZTdEeUdF<ej<>ZVdGeUdH<GdI<64>dJee"j<>dK<00>ZXGdL<64>dMe<18>ZYGdN<64>dOe<1F>ZZGdP<64>dQeZ<65>Z[GdR<64>dSeZ<65>Z\GdT<64>dUe[<5B>Z]GdV<64>dWee#j<>e"j<>dK<00>Z_GdX<64>dYe#j<><00>Z`GdZ<64>d[e`e_<65>Zaeae__by)\zBDefines :class:`_engine.Connection` and :class:`_engine.Engine`.
<EFBFBD>)<01> annotationsN)<01>Any)<01>Callable)<01>cast)<01>Iterable)<01>Iterator)<01>List)<01>Mapping)<01>NoReturn)<01>Optional)<01>overload)<01>Tuple)<01>Type)<01>TypeVar)<01>Union<6F>)<01>
BindTyping)<01>ConnectionEventsTarget)<01> DBAPICursor)<01>ExceptionContext)<01> ExecuteStyle)<01>ExecutionContext)<01>IsolationLevel)<01>_distill_params_20)<01>_distill_raw_params)<01>TransactionalContext<78>)<01>exc)<01>
inspection)<01>log)<01>util)<01>compiler)<01> CursorResult)<01> ScalarResult)<01>_AnyExecuteParams)<01>_AnyMultiExecuteParams)<01>_CoreAnyExecuteParams)<01>_CoreMultiExecuteParams)<01>_CoreSingleExecuteParams)<01>_DBAPIAnyExecuteParams)<01>_DBAPISingleExecuteParams)<01>_ExecuteOptions)<01>CompiledCacheType)<01>CoreExecuteOptionsParameter)<01>Dialect)<01>SchemaTranslateMapType)<01> Inspector)<01>URL)<01>
dispatcher)<01> _EchoFlagType)<01>_ConnectionFairy)<01>Pool)<01>PoolProxiedConnection)<01>
Executable)<01> _InfoType)<01>Compiled)<01>ExecutableDDLElement)<01> SchemaDropper)<01>SchemaGenerator)<01>FunctionElement)<01>DefaultGenerator)<01> HasSchemaAttr)<01>
SchemaItem)<01>TypedReturnsRows<77>_T)<01>boundr,<00>_EMPTY_EXECUTION_OPTSzMapping[str, Any]<5D>
NO_OPTIONSc <01><><00>eZdZUdZded<ded<dZdZded <d
Zd ed <d ed<ded<ded< da dbd<13>ZdZ ded<dcd<16>Z
dcd<17>Z e ddd<18><04>Z ded<19>Zdfd<1A>Zdgd<1B>Zedddd
d
ddddd
d<1D>
dhd<1E><06>Zedid<1F><04>Zdid <20>Zdjd!<21>Ze dkd"<22><04>Ze dkd#<23><04>Ze dkd$<24><04>Ze dld%<25><04>Zdmd&<26>Ze dnd'<27><04>Zdod(<28>Zdld)<29>Ze dpd*<2A><04>Zdqdrd+<2B>Zdsd,<2C>Zdsd-<2D>Zdtd.<2E>Z dud/<2F>Z!dqdvd0<64>Z"dsd1<64>Z#dsd2<64>Z$dwd3<64>Z%dxdyd4<64>Z&dxdyd5<64>Z'dkd6<64>Z(dkd7<64>Z)dkd8<64>Z*dtd9<64>Z+dud:<3A>Z,dzd;<3B>Z-d{d<<3C>Z.d|d=<3D>Z/dsd><3E>Z0dsd?<3F>Z1dqd}d@<40>Z2d~dA<64>Z3d~dB<64>Z4ddC<64>Z5d<35>dD<64>Z6d<36>dE<64>Z7d<37>dF<64>Z8dsdG<64>Z9e dqddH<64> d<>dI<64><07>Z:e dqddH<64> d<>dJ<64><07>Z: dqddH<64> d<>dK<64>Z:e dqddH<64> d<>dL<64><07>Z;e dqddH<64> d<>dM<64><07>Z; dqddH<64> d<>dN<64>Z;e dqddH<64> d<>dO<64><07>Z<e dqddH<64> d<>dP<64><07>Z< dqddH<64> d<>dQ<64>Z< d<>dR<64>Z= d<>dS<64>Z> d<>dT<64>Z? d<>dU<64>Z@ d<>dV<64>ZAeBf d<>dW<64>ZC d<> d<>dX<64>ZD d<>dY<64>ZE d<>dZ<64>ZF d<>d[<5B>ZG dq d<>d\<5C>ZHd<48>d]<5D>ZId
ZJd
ZK dx d<>d^<5E>ZLeM d<> d<>d_<64><05>ZN d<>d`<60>ZOy)<29><>
Connectiona:Provides high-level functionality for a wrapped DB-API connection.
The :class:`_engine.Connection` object is procured by calling the
:meth:`_engine.Engine.connect` method of the :class:`_engine.Engine`
object, and provides services for execution of SQL statements as well
as transaction control.
The Connection object is **not** thread-safe. While a Connection can be
shared among threads using properly synchronized access, it is still
possible that the underlying DBAPI connection may not support shared
access between threads. Check the DBAPI documentation for details.
The Connection object represents a single DBAPI connection checked out
from the connection pool. In this state, the connection pool has no
affect upon the connection, including its expiration or timeout state.
For the connection pool to properly manage connections, connections
should be returned to the connection pool (i.e. ``connection.close()``)
whenever the connection is not in use.
.. index::
single: thread safety; Connection
r/<00>dialect<63>"dispatcher[ConnectionEventsTarget]<5D>dispatchzsqlalchemy.engine.ConnectionNzOptional[TransactionalContext]<5D>_trans_context_managerF<72>Optional[PoolProxiedConnection]<5D>_dbapi_connectionr,<00>_execution_options<6E>Optional[RootTransaction]<5D> _transaction<6F>Optional[NestedTransaction]<5D>_nested_transactionc<01><><00>||_|jx|_}|<02> |j<00>|_n||_dx|_|_ d|_
d|_ ||_ ||_ |jj<00>|_|<03>*|j j#|j <00>|_|xs|duxr |j$|_|j&|_|j$s|jj$r|j j)|<00>yy#|jj
$r}t j|||<01><00>d}~wwxYw)zConstruct a new Connection.NrF)<15>enginerI<00>raw_connectionrN<00> loaded_dbapi<70>ErrorrH<00>$_handle_dbapi_exception_noconnectionrQrS<00>_Connection__savepoint_seq<65>_Connection__in_begin<69>_Connection__can_reconnect<63>_allow_autobegin<69>_should_log_info<66>_echorK<00>_join<69> _has_eventsrO<00>engine_connect)<08>selfrU<00>
2025-08-16 19:28:45 +08:00
connectionra<00>_allow_revalidater]rI<00>errs <20>:D:\aitsc\.venv\Lib\site-packages\sqlalchemy\engine\base.py<70>__init__zConnection.__init__<5F>s=<00><00><1D><04> <0B>!'<27><1E><1E>/<2F><04> <0C>w<EFBFBD> <15> <1D> <16>)/<2F>)><3E>)><3E>)@<40><04>&<26>&0<>D<EFBFBD> "<22>7;<3B>;<3B><04><19>D<EFBFBD>4<> <20><04><1C><1F><04><0F>0<><04><1C> 0<><04><1D><19>[<5B>[<5B>1<>1<>3<><04>
2025-02-23 09:07:52 +08:00
<EFBFBD> <16> <1E>!<21>M<EFBFBD>M<EFBFBD>/<2F>/<2F><06><0F><0F>@<40>D<EFBFBD>M<EFBFBD>&<26>
<EFBFBD> <17>4<EFBFBD> <1F> 6<>F<EFBFBD>$6<>$6<> <0A><18>#)<29>";<3B>";<3B><04><1F> <0F> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <10>M<EFBFBD>M<EFBFBD> (<28> (<28><14> .<2E> 7<><37>7<1B>'<27>'<27>-<2D>-<2D> <16><1A>?<3F>?<3F><17><17>&<26><12><16><>  <16>s<00>D<00>E<03>4E <03> Er<00>_message_formatterc<01><><00>|j}|r||<01>}tjrdtjz|d<|jj
j |g|<02><01>i|<03><01>y<00>Nr<00>
stacklevel)rir <00>
STACKLEVEL<EFBFBD>STACKLEVEL_OFFSETrU<00>logger<65>info<66>rc<00>message<67>arg<72>kw<6B>fmts rg<00> _log_infozConnection._log_info<66>sY<00><00><12>%<25>%<25><03> <0E><19>'<27>l<EFBFBD>G<EFBFBD> <0E>><3E>><3E> <20>3<EFBFBD>#8<>#8<>8<>B<EFBFBD>|<7C> <1C><1F><04> <0B> <0B><1A><1A><1F><1F><07>4<>#<23>4<><12>4<>c<01><><00>|j}|r||<01>}tjrdtjz|d<|jj
j |g|<02><01>i|<03><01>yrk)rir rmrnrUro<00>debugrqs rg<00>
_log_debugzConnection._log_debug<75>sY<00><00><12>%<25>%<25><03> <0E><19>'<27>l<EFBFBD>G<EFBFBD> <0E>><3E>><3E> <20>3<EFBFBD>#8<>#8<>8<>B<EFBFBD>|<7C> <1C> <20><04> <0B> <0B><1A><1A> <20> <20><17>5<>3<EFBFBD>5<>"<22>5rwc<01>><00>|jjdd<00>}|S)N<>schema_translate_map)rO<00>get)rcr|s rg<00>_schema_translate_mapz Connection._schema_translate_map<61>s(<00><00> <11> #<23> #<23> '<27> '<27>(><3E><04> E<> <1D>$<24>#rwc<01><><00>|j}|jjdd<02>}|r||vr|jr||S|S)ztReturn the schema name for the given schema item taking into
account current schema translate map.
r|N)<04>schemarOr}<00>_use_schema_map)rc<00>obj<62>namer|s rg<00>schema_for_objectzConnection.schema_for_object<63>sP<00><00> <13>z<EFBFBD>z<EFBFBD><04> <10> #<23> #<23> '<27> '<27>(><3E><04> E<> <1D>
!<21><14>,<2C>,<2C><13>#<23>#<23>'<27><04>-<2D> -<2D><17>Krwc<01><00>|S<00>N<><00>rcs rg<00> __enter__zConnection.__enter__<5F>s<00><00><13> rwc<01>$<00>|j<00>yr<>)<01>close)rc<00>type_<65>value<75> tracebacks rg<00>__exit__zConnection.__exit__<5F>s <00><00> <0C>
<EFBFBD>
<EFBFBD> rw.)
<EFBFBD>compiled_cache<68> logging_token<65>isolation_level<65> no_parameters<72>stream_results<74>max_row_buffer<65> yield_per<65>insertmanyvalues_page_sizer|<00>preserve_rowcountc
<01><00>yr<>r<>) rcr<>r<>r<>r<>r<>r<>r<>r<>r|r<><00>opts rg<00>execution_optionszConnection.execution_options<6E>s<00><00>rwc <01><00>yr<>r<><00>rcr<>s rgr<>zConnection.execution_options<6E>s<00><00>;>rwc <01><><00>|js|jjr|jj||<01>|jj |<01>|_|j j||<01>|S)a<>0Set non-SQL options for the connection which take effect
during execution.
This method modifies this :class:`_engine.Connection` **in-place**;
the return value is the same :class:`_engine.Connection` object
upon which the method is called. Note that this is in contrast
to the behavior of the ``execution_options`` methods on other
objects such as :meth:`_engine.Engine.execution_options` and
:meth:`_sql.Executable.execution_options`. The rationale is that many
such execution options necessarily modify the state of the base
DBAPI connection in any case so there is no feasible means of
keeping the effect of such an option localized to a "sub" connection.
.. versionchanged:: 2.0 The :meth:`_engine.Connection.execution_options`
method, in contrast to other objects with this method, modifies
the connection in-place without creating copy of it.
As discussed elsewhere, the :meth:`_engine.Connection.execution_options`
method accepts any arbitrary parameters including user defined names.
All parameters given are consumable in a number of ways including
by using the :meth:`_engine.Connection.get_execution_options` method.
See the examples at :meth:`_sql.Executable.execution_options`
and :meth:`_engine.Engine.execution_options`.
The keywords that are currently recognized by SQLAlchemy itself
include all those listed under :meth:`.Executable.execution_options`,
as well as others that are specific to :class:`_engine.Connection`.
:param compiled_cache: Available on: :class:`_engine.Connection`,
:class:`_engine.Engine`.
A dictionary where :class:`.Compiled` objects
will be cached when the :class:`_engine.Connection`
compiles a clause
expression into a :class:`.Compiled` object. This dictionary will
supersede the statement cache that may be configured on the
:class:`_engine.Engine` itself. If set to None, caching
is disabled, even if the engine has a configured cache size.
Note that the ORM makes use of its own "compiled" caches for
some operations, including flush operations. The caching
used by the ORM internally supersedes a cache dictionary
specified here.
:param logging_token: Available on: :class:`_engine.Connection`,
:class:`_engine.Engine`, :class:`_sql.Executable`.
Adds the specified string token surrounded by brackets in log
messages logged by the connection, i.e. the logging that's enabled
either via the :paramref:`_sa.create_engine.echo` flag or via the
``logging.getLogger("sqlalchemy.engine")`` logger. This allows a
per-connection or per-sub-engine token to be available which is
useful for debugging concurrent connection scenarios.
.. versionadded:: 1.4.0b2
.. seealso::
:ref:`dbengine_logging_tokens` - usage example
:paramref:`_sa.create_engine.logging_name` - adds a name to the
name used by the Python logger object itself.
:param isolation_level: Available on: :class:`_engine.Connection`,
:class:`_engine.Engine`.
Set the transaction isolation level for the lifespan of this
:class:`_engine.Connection` object.
Valid values include those string
values accepted by the :paramref:`_sa.create_engine.isolation_level`
parameter passed to :func:`_sa.create_engine`. These levels are
semi-database specific; see individual dialect documentation for
valid levels.
The isolation level option applies the isolation level by emitting
statements on the DBAPI connection, and **necessarily affects the
original Connection object overall**. The isolation level will remain
at the given setting until explicitly changed, or when the DBAPI
connection itself is :term:`released` to the connection pool, i.e. the
:meth:`_engine.Connection.close` method is called, at which time an
event handler will emit additional statements on the DBAPI connection
in order to revert the isolation level change.
.. note:: The ``isolation_level`` execution option may only be
established before the :meth:`_engine.Connection.begin` method is
called, as well as before any SQL statements are emitted which
would otherwise trigger "autobegin", or directly after a call to
:meth:`_engine.Connection.commit` or
:meth:`_engine.Connection.rollback`. A database cannot change the
isolation level on a transaction in progress.
.. note:: The ``isolation_level`` execution option is implicitly
reset if the :class:`_engine.Connection` is invalidated, e.g. via
the :meth:`_engine.Connection.invalidate` method, or if a
disconnection error occurs. The new connection produced after the
invalidation will **not** have the selected isolation level
re-applied to it automatically.
.. seealso::
:ref:`dbapi_autocommit`
:meth:`_engine.Connection.get_isolation_level`
- view current actual level
:param no_parameters: Available on: :class:`_engine.Connection`,
:class:`_sql.Executable`.
When ``True``, if the final parameter
list or dictionary is totally empty, will invoke the
statement on the cursor as ``cursor.execute(statement)``,
not passing the parameter collection at all.
Some DBAPIs such as psycopg2 and mysql-python consider
percent signs as significant only when parameters are
present; this option allows code to generate SQL
containing percent signs (and possibly other characters)
that is neutral regarding whether it's executed by the DBAPI
or piped into a script that's later invoked by
command line tools.
:param stream_results: Available on: :class:`_engine.Connection`,
:class:`_sql.Executable`.
Indicate to the dialect that results should be "streamed" and not
pre-buffered, if possible. For backends such as PostgreSQL, MySQL
and MariaDB, this indicates the use of a "server side cursor" as
opposed to a client side cursor. Other backends such as that of
Oracle Database may already use server side cursors by default.
The usage of
:paramref:`_engine.Connection.execution_options.stream_results` is
usually combined with setting a fixed number of rows to to be fetched
in batches, to allow for efficient iteration of database rows while
at the same time not loading all result rows into memory at once;
this can be configured on a :class:`_engine.Result` object using the
:meth:`_engine.Result.yield_per` method, after execution has
returned a new :class:`_engine.Result`. If
:meth:`_engine.Result.yield_per` is not used,
the :paramref:`_engine.Connection.execution_options.stream_results`
mode of operation will instead use a dynamically sized buffer
which buffers sets of rows at a time, growing on each batch
based on a fixed growth size up until a limit which may
be configured using the
:paramref:`_engine.Connection.execution_options.max_row_buffer`
parameter.
When using the ORM to fetch ORM mapped objects from a result,
:meth:`_engine.Result.yield_per` should always be used with
:paramref:`_engine.Connection.execution_options.stream_results`,
so that the ORM does not fetch all rows into new ORM objects at once.
For typical use, the
:paramref:`_engine.Connection.execution_options.yield_per` execution
option should be preferred, which sets up both
:paramref:`_engine.Connection.execution_options.stream_results` and
:meth:`_engine.Result.yield_per` at once. This option is supported
both at a core level by :class:`_engine.Connection` as well as by the
ORM :class:`_engine.Session`; the latter is described at
:ref:`orm_queryguide_yield_per`.
.. seealso::
:ref:`engine_stream_results` - background on
:paramref:`_engine.Connection.execution_options.stream_results`
:paramref:`_engine.Connection.execution_options.max_row_buffer`
:paramref:`_engine.Connection.execution_options.yield_per`
:ref:`orm_queryguide_yield_per` - in the :ref:`queryguide_toplevel`
describing the ORM version of ``yield_per``
:param max_row_buffer: Available on: :class:`_engine.Connection`,
:class:`_sql.Executable`. Sets a maximum
buffer size to use when the
:paramref:`_engine.Connection.execution_options.stream_results`
execution option is used on a backend that supports server side
cursors. The default value if not specified is 1000.
.. seealso::
:paramref:`_engine.Connection.execution_options.stream_results`
:ref:`engine_stream_results`
:param yield_per: Available on: :class:`_engine.Connection`,
:class:`_sql.Executable`. Integer value applied which will
set the :paramref:`_engine.Connection.execution_options.stream_results`
execution option and invoke :meth:`_engine.Result.yield_per`
automatically at once. Allows equivalent functionality as
is present when using this parameter with the ORM.
.. versionadded:: 1.4.40
.. seealso::
:ref:`engine_stream_results` - background and examples
on using server side cursors with Core.
:ref:`orm_queryguide_yield_per` - in the :ref:`queryguide_toplevel`
describing the ORM version of ``yield_per``
:param insertmanyvalues_page_size: Available on: :class:`_engine.Connection`,
:class:`_engine.Engine`. Number of rows to format into an
INSERT statement when the statement uses "insertmanyvalues" mode,
which is a paged form of bulk insert that is used for many backends
when using :term:`executemany` execution typically in conjunction
with RETURNING. Defaults to 1000. May also be modified on a
per-engine basis using the
:paramref:`_sa.create_engine.insertmanyvalues_page_size` parameter.
.. versionadded:: 2.0
.. seealso::
:ref:`engine_insertmanyvalues`
:param schema_translate_map: Available on: :class:`_engine.Connection`,
:class:`_engine.Engine`, :class:`_sql.Executable`.
A dictionary mapping schema names to schema names, that will be
applied to the :paramref:`_schema.Table.schema` element of each
:class:`_schema.Table`
encountered when SQL or DDL expression elements
are compiled into strings; the resulting schema name will be
converted based on presence in the map of the original name.
.. seealso::
:ref:`schema_translating`
:param preserve_rowcount: Boolean; when True, the ``cursor.rowcount``
attribute will be unconditionally memoized within the result and
made available via the :attr:`.CursorResult.rowcount` attribute.
Normally, this attribute is only preserved for UPDATE and DELETE
statements. Using this option, the DBAPIs rowcount value can
be accessed for other kinds of statements such as INSERT and SELECT,
to the degree that the DBAPI supports these statements. See
:attr:`.CursorResult.rowcount` for notes regarding the behavior
of this attribute.
.. versionadded:: 2.0.28
.. seealso::
:meth:`_engine.Engine.execution_options`
:meth:`.Executable.execution_options`
:meth:`_engine.Connection.get_execution_options`
:ref:`orm_queryguide_execution_options` - documentation on all
ORM-specific execution options
)rarUrK<00> set_connection_execution_optionsrO<00>unionrIr<>s rgr<>zConnection.execution_optionss`<00><00>B <10> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <10>M<EFBFBD>M<EFBFBD> :<3A> :<3A>4<EFBFBD><13> E<>"&<26>"9<>"9<>"?<3F>"?<3F><03>"D<><04><1F> <0C> <0C> <0C>5<>5<>d<EFBFBD>C<EFBFBD>@<40><13> rwc<01><00>|jS)z<>Get the non-SQL options which will take effect during execution.
.. versionadded:: 1.3
.. seealso::
:meth:`_engine.Connection.execution_options`
<20>rOr<>s rg<00>get_execution_optionsz Connection.get_execution_options<00><00><00><14>&<26>&<26>&rwc<01>><00>|j}|duxr |jSr<>)rN<00>is_valid<69>rc<00>pool_proxied_connections rg<00>)_still_open_and_dbapi_connection_is_validz4Connection._still_open_and_dbapi_connection_is_valids)<00><00>"&<26>"8<>"8<><1F> #<23>4<EFBFBD> /<2F> 1<>'<27>0<>0<>
rwc<01><<00>|jduxr |j S)z)Return True if this connection is closed.N<>rNr\r<>s rg<00>closedzConnection.closeds#<00><00><14>%<25>%<25><14>-<2D>J<>d<EFBFBD>6J<36>6J<36>2J<32>Jrwc<01>><00>|j}|duxr |jS)z<>Return True if this connection was invalidated.
This does not indicate whether or not the connection was
invalidated at the pool level, however
Nr<4E>r<>s rg<00> invalidatedzConnection.invalidated!s&<00><00>$#'<27>"8<>"8<><1F>&<26>$<24>.<2E>G<>4<EFBFBD>3G<33>3G<33>Grwc<01><><00>|j<00> |j<00>S|jS#tjtjf$r<00>t
$r}|j |dddd<01>Yd}~yd}~wwxYw)aVThe underlying DB-API connection managed by this Connection.
This is a SQLAlchemy connection-pool proxied connection
which then has the attribute
:attr:`_pool._ConnectionFairy.dbapi_connection` that refers to the
actual driver connection.
.. seealso::
:ref:`dbapi_connections`
N)rN<00>_revalidate_connectionr<00>PendingRollbackError<6F>ResourceClosedError<6F> BaseException<6F>_handle_dbapi_exception<6F>rc<00>es rgrdzConnection.connection6s|<00><00> <10> !<21> !<21> )<29> H<01><1B>2<>2<>4<>4<> <18>)<29>)<29> )<29><> <18>,<2C>,<2C>c<EFBFBD>.E<>.E<>F<> <16><15> <20> H<01><14>,<2C>,<2C>Q<EFBFBD><04>d<EFBFBD>D<EFBFBD>$<24>G<>G<><47> H<01>s<00>*<00>,A5<03>A0<03>0A5c<01><><00>|jj}|<01>J<00> |jj|<01>S#t$r}|j |dddd<01>Yd}~yd}~wwxYw)a<>Return the current **actual** isolation level that's present on
the database within the scope of this connection.
This attribute will perform a live SQL operation against the database
in order to procure the current isolation level, so the value returned
is the actual level on the underlying DBAPI connection regardless of
how this state was set. This will be one of the four actual isolation
modes ``READ UNCOMMITTED``, ``READ COMMITTED``, ``REPEATABLE READ``,
``SERIALIZABLE``. It will **not** include the ``AUTOCOMMIT`` isolation
level setting. Third party dialects may also feature additional
isolation level settings.
.. note:: This method **will not report** on the ``AUTOCOMMIT``
isolation level, which is a separate :term:`dbapi` setting that's
independent of **actual** isolation level. When ``AUTOCOMMIT`` is
in use, the database connection still has a "traditional" isolation
mode in effect, that is typically one of the four values
``READ UNCOMMITTED``, ``READ COMMITTED``, ``REPEATABLE READ``,
``SERIALIZABLE``.
Compare to the :attr:`_engine.Connection.default_isolation_level`
accessor which returns the isolation level that is present on the
database at initial connection time.
.. seealso::
:attr:`_engine.Connection.default_isolation_level`
- view default level
:paramref:`_sa.create_engine.isolation_level`
- set per :class:`_engine.Engine` isolation level
:paramref:`.Connection.execution_options.isolation_level`
- set per :class:`_engine.Connection` isolation level
N)rd<00>dbapi_connectionrI<00>get_isolation_levelr<6C>r<>)rcr<>r<>s rgr<>zConnection.get_isolation_levelPsh<00><00>J <20>?<3F>?<3F>;<3B>;<3B><18><1F>+<2B>+<2B>+<2B> D<01><17><<3C><<3C>3<>3<>4D<34>E<> E<><45><1C> D<01> <10> (<28> (<28><11>D<EFBFBD>$<24><04>d<EFBFBD> C<> C<><43> D<01>s<00>7<00> A<03>A<03>Ac<01>.<00>|jjS)a<>The initial-connection time isolation level associated with the
:class:`_engine.Dialect` in use.
This value is independent of the
:paramref:`.Connection.execution_options.isolation_level` and
:paramref:`.Engine.execution_options.isolation_level` execution
options, and is determined by the :class:`_engine.Dialect` when the
first connection is created, by performing a SQL query against the
database for the current isolation level before any additional commands
have been emitted.
Calling this accessor does not invoke any new SQL queries.
.. seealso::
:meth:`_engine.Connection.get_isolation_level`
- view current actual isolation level
:paramref:`_sa.create_engine.isolation_level`
- set per :class:`_engine.Engine` isolation level
:paramref:`.Connection.execution_options.isolation_level`
- set per :class:`_engine.Connection` isolation level
)rI<00>default_isolation_levelr<6C>s rgr<>z"Connection.default_isolation_level|s<00><00>6<14>|<7C>|<7C>3<>3<>3rwc<01>R<00>tjd|j<00>dndzd<04><05><00>)NzfCan't reconnect until invalid %stransaction is rolled back. Please rollback() fully before proceedingz
savepoint <20><00>8s2b)<01>code)rr<>rSr<>s rg<00>_invalid_transactionzConnection._invalid_transaction<6F>s5<00><00><11>&<26>&<26> ?<3F>#<23>7<>7<>C<>|<7C><12> M<01><18> 
<EFBFBD>
rwc<01><><00>|jrS|jrG|j<00>|j<00>|jj <00>|_|j Stjd<01><00>)N<>This Connection is closed) r\r<>rQr<>rUrVrNrr<>r<>s rgr<>z!Connection._revalidate_connection<6F>s^<00><00> <0F> <1F> <1F>D<EFBFBD>$4<>$4<><13> <20> <20>,<2C><14>)<29>)<29>+<2B>%)<29>[<5B>[<5B>%?<3F>%?<3F>%A<>D<EFBFBD> "<22><17>)<29>)<29> )<29><11>%<25>%<25>&A<>B<>Brwc<01>.<00>|jjS)a<>Info dictionary associated with the underlying DBAPI connection
referred to by this :class:`_engine.Connection`, allowing user-defined
data to be associated with the connection.
The data here will follow along with the DBAPI connection including
after it is returned to the connection pool and used again
in subsequent instances of :class:`_engine.Connection`.
)rdrpr<>s rgrpzConnection.info<66>s<00><00><14><EFBFBD><EFBFBD>#<23>#<23>#rwc<01><><00>|jry|jrtjd<02><00>|jr!|j
}|<02>J<00>|j |<01>d|_y)a<>Invalidate the underlying DBAPI connection associated with
this :class:`_engine.Connection`.
An attempt will be made to close the underlying DBAPI connection
immediately; however if this operation fails, the error is logged
but not raised. The connection is then discarded whether or not
close() succeeded.
Upon the next use (where "use" typically means using the
:meth:`_engine.Connection.execute` method or similar),
this :class:`_engine.Connection` will attempt to
procure a new DBAPI connection using the services of the
:class:`_pool.Pool` as a source of connectivity (e.g.
a "reconnection").
If a transaction was in progress (e.g. the
:meth:`_engine.Connection.begin` method has been called) when
:meth:`_engine.Connection.invalidate` method is called, at the DBAPI
level all state associated with this transaction is lost, as
the DBAPI connection is closed. The :class:`_engine.Connection`
will not allow a reconnection to proceed until the
:class:`.Transaction` object is ended, by calling the
:meth:`.Transaction.rollback` method; until that point, any attempt at
continuing to use the :class:`_engine.Connection` will raise an
:class:`~sqlalchemy.exc.InvalidRequestError`.
This is to prevent applications from accidentally
continuing an ongoing transactional operations despite the
fact that the transaction has been lost due to an
invalidation.
The :meth:`_engine.Connection.invalidate` method,
just like auto-invalidation,
will at the connection pool level invoke the
:meth:`_events.PoolEvents.invalidate` event.
:param exception: an optional ``Exception`` instance that's the
reason for the invalidation. is passed along to event handlers
and logging functions.
.. seealso::
:ref:`pool_connection_invalidation`
Nr<4E>)r<>r<>rr<>r<>rN<00>
invalidate)rc<00> exceptionr<6E>s rgr<>zConnection.invalidate<74>sa<00><00>\ <10> <1B> <1B> <12> <0F>;<3B>;<3B><15>)<29>)<29>*E<>F<> F<> <0F> 9<> 9<>&*<2A>&<<3C>&<<3C> #<23>*<2A>6<> 6<>6<> #<23> .<2E> .<2E>y<EFBFBD> 9<>!%<25><04>rwc<01><><00>|jrtjd<01><00>|j}|<01>tjd<03><00>|j <00>y)a2Detach the underlying DB-API connection from its connection pool.
E.g.::
with engine.connect() as conn:
conn.detach()
conn.execute(text("SET search_path TO schema1, schema2"))
# work with connection
# connection is fully closed (since we used "with:", can
# also call .close())
This :class:`_engine.Connection` instance will remain usable.
When closed
(or exited from a context manager context as above),
the DB-API connection will be literally closed and not
returned to its originating pool.
This method can be used to insulate the rest of an application
from a modified state on a connection (such as a transaction
isolation level or similar).
r<>Nz&Can't detach an invalidated Connection)r<>rr<>rN<00>InvalidRequestError<6F>detachr<68>s rgr<>zConnection.detach<63>sS<00><00>4 <10>;<3B>;<3B><15>)<29>)<29>*E<>F<> F<>"&<26>"8<>"8<><1F> "<22> *<2A><15>)<29>)<29>8<><0E> <0E> <20>&<26>&<26>(rwc<01>X<00>|jr|js|j<00>yyyr<>)r]r[<00>beginr<6E>s rg<00>
_autobeginzConnection._autobegins"<00><00> <0F> <20> <20><14><1F><1F> <10>J<EFBFBD>J<EFBFBD>L<EFBFBD>*9<> rwc<01>|<00>|j<00>t|<00>|_|jStjd<01><00>)a<> Begin a transaction prior to autobegin occurring.
E.g.::
with engine.connect() as conn:
with conn.begin() as trans:
conn.execute(table.insert(), {"username": "sandy"})
The returned object is an instance of :class:`_engine.RootTransaction`.
This object represents the "scope" of the transaction,
which completes when either the :meth:`_engine.Transaction.rollback`
or :meth:`_engine.Transaction.commit` method is called; the object
also works as a context manager as illustrated above.
The :meth:`_engine.Connection.begin` method begins a
transaction that normally will be begun in any case when the connection
is first used to execute a statement. The reason this method might be
used would be to invoke the :meth:`_events.ConnectionEvents.begin`
event at a specific time, or to organize code within the scope of a
connection checkout in terms of context managed blocks, such as::
with engine.connect() as conn:
with conn.begin():
conn.execute(...)
conn.execute(...)
with conn.begin():
conn.execute(...)
conn.execute(...)
The above code is not fundamentally any different in its behavior than
the following code which does not use
:meth:`_engine.Connection.begin`; the below style is known
as "commit as you go" style::
with engine.connect() as conn:
conn.execute(...)
conn.execute(...)
conn.commit()
conn.execute(...)
conn.execute(...)
conn.commit()
From a database point of view, the :meth:`_engine.Connection.begin`
method does not emit any SQL or change the state of the underlying
DBAPI connection in any way; the Python DBAPI does not have any
concept of explicit transaction begin.
.. seealso::
:ref:`tutorial_working_with_transactions` - in the
:ref:`unified_tutorial`
:meth:`_engine.Connection.begin_nested` - use a SAVEPOINT
:meth:`_engine.Connection.begin_twophase` -
use a two phase /XID transaction
:meth:`_engine.Engine.begin` - context manager available from
:class:`_engine.Engine`
z<>This connection has already initialized a SQLAlchemy Transaction() object via begin() or autobegin; can't call begin() here unless rollback() or commit() is called first.)rQ<00>RootTransactionrr<>r<>s rgr<>zConnection.beginsB<00><00>@ <10> <1C> <1C> $<24> /<2F><04> 5<>D<EFBFBD> <1D><17>$<24>$<24> $<24><15>)<29>)<29>#<23><0E> rwc<01>P<00>|j<00>|j<00>t|<00>S)a<> Begin a nested transaction (i.e. SAVEPOINT) and return a transaction
handle that controls the scope of the SAVEPOINT.
E.g.::
with engine.begin() as connection:
with connection.begin_nested():
connection.execute(table.insert(), {"username": "sandy"})
The returned object is an instance of
:class:`_engine.NestedTransaction`, which includes transactional
methods :meth:`_engine.NestedTransaction.commit` and
:meth:`_engine.NestedTransaction.rollback`; for a nested transaction,
these methods correspond to the operations "RELEASE SAVEPOINT <name>"
and "ROLLBACK TO SAVEPOINT <name>". The name of the savepoint is local
to the :class:`_engine.NestedTransaction` object and is generated
automatically. Like any other :class:`_engine.Transaction`, the
:class:`_engine.NestedTransaction` may be used as a context manager as
illustrated above which will "release" or "rollback" corresponding to
if the operation within the block were successful or raised an
exception.
Nested transactions require SAVEPOINT support in the underlying
database, else the behavior is undefined. SAVEPOINT is commonly used to
run operations within a transaction that may fail, while continuing the
outer transaction. E.g.::
from sqlalchemy import exc
with engine.begin() as connection:
trans = connection.begin_nested()
try:
connection.execute(table.insert(), {"username": "sandy"})
trans.commit()
except exc.IntegrityError: # catch for duplicate username
trans.rollback() # rollback to savepoint
# outer transaction continues
connection.execute(...)
If :meth:`_engine.Connection.begin_nested` is called without first
calling :meth:`_engine.Connection.begin` or
:meth:`_engine.Engine.begin`, the :class:`_engine.Connection` object
will "autobegin" the outer transaction first. This outer transaction
may be committed using "commit-as-you-go" style, e.g.::
with engine.connect() as connection: # begin() wasn't called
with connection.begin_nested(): # will auto-"begin()" first
connection.execute(...)
# savepoint is released
connection.execute(...)
# explicitly commit outer transaction
connection.commit()
# can continue working with connection here
.. versionchanged:: 2.0
:meth:`_engine.Connection.begin_nested` will now participate
in the connection "autobegin" behavior that is new as of
2.0 / "future" style connections in 1.4.
.. seealso::
:meth:`_engine.Connection.begin`
:ref:`session_begin_nested` - ORM support for SAVEPOINT
)rQr<><00>NestedTransactionr<6E>s rg<00> begin_nestedzConnection.begin_nestedes&<00><00>R <10> <1C> <1C> $<24> <10>O<EFBFBD>O<EFBFBD> <1D> <20><14>&<26>&rwc<01><><00>|j<00>tjd<01><00>|<01>$|jjj <00>}t ||<01>S)a'Begin a two-phase or XA transaction and return a transaction
handle.
The returned object is an instance of :class:`.TwoPhaseTransaction`,
which in addition to the methods provided by
:class:`.Transaction`, also provides a
:meth:`~.TwoPhaseTransaction.prepare` method.
:param xid: the two phase transaction id. If not supplied, a
random id will be generated.
.. seealso::
:meth:`_engine.Connection.begin`
:meth:`_engine.Connection.begin_twophase`
zOCannot start a two phase transaction when a transaction is already in progress.)rQrr<>rUrI<00>
create_xid<EFBFBD>TwoPhaseTransaction)rc<00>xids rg<00>begin_twophasezConnection.begin_twophase<73>sT<00><00>( <10> <1C> <1C> (<28><15>)<29>)<29>*<2A><0E> <0E> <0F>;<3B><16>+<2B>+<2B>%<25>%<25>0<>0<>2<>C<EFBFBD>"<22>4<EFBFBD><13>-<2D>-rwc<01>R<00>|jr|jj<00>yy)aCommit the transaction that is currently in progress.
This method commits the current transaction if one has been started.
If no transaction was started, the method has no effect, assuming
the connection is in a non-invalidated state.
A transaction is begun on a :class:`_engine.Connection` automatically
whenever a statement is first executed, or when the
:meth:`_engine.Connection.begin` method is called.
.. note:: The :meth:`_engine.Connection.commit` method only acts upon
the primary database transaction that is linked to the
:class:`_engine.Connection` object. It does not operate upon a
SAVEPOINT that would have been invoked from the
:meth:`_engine.Connection.begin_nested` method; for control of a
SAVEPOINT, call :meth:`_engine.NestedTransaction.commit` on the
:class:`_engine.NestedTransaction` that is returned by the
:meth:`_engine.Connection.begin_nested` method itself.
N)rQ<00>commitr<74>s rgr<>zConnection.commit<69>s$<00><00>, <10> <1C> <1C> <10> <1D> <1D> $<24> $<24> &<26> rwc<01>R<00>|jr|jj<00>yy)aYRoll back the transaction that is currently in progress.
This method rolls back the current transaction if one has been started.
If no transaction was started, the method has no effect. If a
transaction was started and the connection is in an invalidated state,
the transaction is cleared using this method.
A transaction is begun on a :class:`_engine.Connection` automatically
whenever a statement is first executed, or when the
:meth:`_engine.Connection.begin` method is called.
.. note:: The :meth:`_engine.Connection.rollback` method only acts
upon the primary database transaction that is linked to the
:class:`_engine.Connection` object. It does not operate upon a
SAVEPOINT that would have been invoked from the
:meth:`_engine.Connection.begin_nested` method; for control of a
SAVEPOINT, call :meth:`_engine.NestedTransaction.rollback` on the
:class:`_engine.NestedTransaction` that is returned by the
:meth:`_engine.Connection.begin_nested` method itself.
N)rQ<00>rollbackr<6B>s rgr<>zConnection.rollback<63>s$<00><00>. <10> <1C> <1C> <10> <1D> <1D> &<26> &<26> (<28> rwc<01>L<00>|jjj|<00>Sr<>)rUrI<00>do_recover_twophaser<65>s rg<00>recover_twophasezConnection.recover_twophases<00><00><13>{<7B>{<7B>"<22>"<22>6<>6<>t<EFBFBD><<3C><rwc<01>T<00>|jjj|||<02><01>y<00>N)<01>recover)rUrI<00>do_rollback_twophase<73>rcr<>r<>s rg<00>rollback_preparedzConnection.rollback_prepareds!<00><00> <0C> <0B> <0B><1B><1B>0<>0<><14>s<EFBFBD>G<EFBFBD>0<>Lrwc<01>T<00>|jjj|||<02><01>yr<>)rUrI<00>do_commit_twophaser<65>s rg<00>commit_preparedzConnection.commit_prepared s!<00><00> <0C> <0B> <0B><1B><1B>.<2E>.<2E>t<EFBFBD>S<EFBFBD>'<27>.<2E>Jrwc<01>N<00>|jduxr|jjS<00>z,Return True if a transaction is in progress.N)rQ<00> is_activer<65>s rg<00>in_transactionzConnection.in_transaction s$<00><00><13> <20> <20><04>,<2C>L<><14>1B<31>1B<31>1L<31>1L<31>Lrwc<01>N<00>|jduxr|jjSr<>)rSr<>r<>s rg<00>in_nested_transactionz Connection.in_nested_transactions+<00><00> <11> $<24> $<24>D<EFBFBD> 0<> 3<><14>(<28>(<28>2<>2<>
rwc<01><><00>|jjdd<00>}t|dk(xs)|duxr#|jjj
dk(<00>S)Nr<4E><00>
AUTOCOMMIT)rOr}<00>boolrUrI<00>_on_connect_isolation_level)rc<00>opt_isos rg<00>_is_autocommit_isolationz#Connection._is_autocommit_isolations\<00><00><16>)<29>)<29>-<2D>-<2D>.?<3F><14>F<><07><13> <13>|<7C> #<23> <0E><17>4<EFBFBD><0F> <20><18>K<EFBFBD>K<EFBFBD>'<27>'<27>C<>C<><1F> <20> 
<EFBFBD>
rwc<01>L<00>|j}|<01>tjd<01><00>|S)Nz"connection is not in a transaction)rQrr<><00>rc<00>transs rg<00>_get_required_transactionz$Connection._get_required_transaction"s)<00><00><14>!<21>!<21><05> <10>=<3D><15>)<29>)<29>*N<>O<> O<><14> rwc<01>L<00>|j}|<01>tjd<01><00>|S)Nz)connection is not in a nested transaction)rSrr<>r<>s rg<00> _get_required_nested_transactionz+Connection._get_required_nested_transaction(s/<00><00><14>(<28>(<28><05> <10>=<3D><15>)<29>)<29>;<3B><0E> <0E><15> rwc<01><00>|jS)zaReturn the current root transaction in progress, if any.
.. versionadded:: 1.4
)rQr<>s rg<00>get_transactionzConnection.get_transaction0s<00><00><14> <20> <20> rwc<01><00>|jS)zcReturn the current nested transaction in progress, if any.
.. versionadded:: 1.4
)rSr<>s rg<00>get_nested_transactionz!Connection.get_nested_transaction9s<00><00> <14>'<27>'<27>'rwc<01><><00>|jr3|j<00>r|jd<01>n|jd<02>d|_|js|j
jr|j j|<00> |j
jj|j<00>d|_y#t$r}|j|dddd<00>Yd}~<02>+d}~wwxYw#d|_wxYw)Nz?BEGIN (implicit; DBAPI should not BEGIN due to autocommit mode)zBEGIN (implicit)TF) r_r<>rvr[rarUrKr<>rI<00>do_beginrdr<>r<><00>rc<00> transactionr<6E>s rg<00> _begin_implzConnection._begin_implAs<><00><00> <0F>:<3A>:<3A><13>,<2C>,<2C>.<2E><14><0E><0E>'<27><12>
<15><0E><0E>1<>2<><1E><04><0F> <0F> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <10>M<EFBFBD>M<EFBFBD> <1F> <1F><04> %<25> $<24> <10>K<EFBFBD>K<EFBFBD> <1F> <1F> (<28> (<28><14><1F><1F> 9<>$<24>D<EFBFBD>O<EFBFBD><4F><1D> D<01> <10> (<28> (<28><11>D<EFBFBD>$<24><04>d<EFBFBD> C<> C<><43> D<01><>$<24>D<EFBFBD>O<EFBFBD>s*<00>/B<<00>< C$<03>C<03>C'<00>C$<03>$C'<00>' C0c<01><><00>|js|jjr|jj|<00>|jrp|j
r3|j <00>r|jd<01>n|jd<02> |jjj|j<00>yy#t$r}|j|dddd<00>Yd}~yd}~wwxYw)NzVROLLBACK using DBAPI connection.rollback(), DBAPI should ignore due to autocommit mode<64>ROLLBACK) rarUrKr<>r<>r_r<>rvrI<00> do_rollbackrdr<>r<>r<>s rg<00>_rollback_implzConnection._rollback_implWs<><00><00> <0F> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <10>M<EFBFBD>M<EFBFBD> "<22> "<22>4<EFBFBD> (<28> <0F> 9<> 9<><13>z<EFBFBD>z<EFBFBD><17>0<>0<>2<><18>N<EFBFBD>N<EFBFBD>E<01><16>
<19>N<EFBFBD>N<EFBFBD>:<3A>.<2E> H<01><14> <0B> <0B>#<23>#<23>/<2F>/<2F><04><0F><0F>@<40> :<3A><>!<21> H<01><14>,<2C>,<2C>Q<EFBFBD><04>d<EFBFBD>D<EFBFBD>$<24>G<>G<><47> H<01>s<00>
/B;<00>; C#<03>C<03>C#c<01><><00>|js|jjr|jj|<00>|jr3|j <00>r|j d<01>n|j d<02> |jjj|j<00>y#t$r}|j|dddd<00>Yd}~yd}~wwxYw)NzRCOMMIT using DBAPI connection.commit(), DBAPI should ignore due to autocommit mode<64>COMMIT) rarUrKr<>r_r<>rvrI<00> do_commitrdr<>r<>r<>s rg<00> _commit_implzConnection._commit_implis<><00><00> <0F> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <10>M<EFBFBD>M<EFBFBD> <20> <20><14> &<26> <0F>:<3A>:<3A><13>,<2C>,<2C>.<2E><14><0E><0E>A<01><12>
<15><0E><0E>x<EFBFBD>(<28> D<01> <10>K<EFBFBD>K<EFBFBD> <1F> <1F> )<29> )<29>$<24>/<2F>/<2F> :<3A><><1C> D<01> <10> (<28> (<28><11>D<EFBFBD>$<24><04>d<EFBFBD> C<> C<><43> D<01>s<00>>/B.<00>. C<03>7C<03>Cc<01><00>|js|jjr|jj||<01>|<01>$|xjdz c_d|jz}|jj
j ||<01>|S)Nrzsa_savepoint_%s)rarUrK<00> savepointrZrI<00> do_savepoint<6E>rcr<>s rg<00>_savepoint_implzConnection._savepoint_implzsp<00><00> <0F> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <10>M<EFBFBD>M<EFBFBD> #<23> #<23>D<EFBFBD>$<24> /<2F> <0F><<3C> <10> <20> <20>A<EFBFBD> %<25> <20>$<24>t<EFBFBD>';<3B>';<3B>;<3B>D<EFBFBD> <0C> <0B> <0B><1B><1B>(<28>(<28><14>t<EFBFBD>4<><13> rwc<01><><00>|js|jjr|jj||d<00>|jr'|jj
j ||<01>yyr<>)rarUrK<00>rollback_savepointr<74>rI<00>do_rollback_to_savepointr s rg<00>_rollback_to_savepoint_implz&Connection._rollback_to_savepoint_impl<70>sU<00><00> <0F> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <10>M<EFBFBD>M<EFBFBD> ,<2C> ,<2C>T<EFBFBD>4<EFBFBD><14> ><3E> <0F> 9<> 9<> <10>K<EFBFBD>K<EFBFBD> <1F> <1F> 8<> 8<><14>t<EFBFBD> D<> :rwc<01><><00>|js|jjr|jj||d<00>|jjj ||<01>yr<>)rarUrK<00>release_savepointrI<00>do_release_savepointr s rg<00>_release_savepoint_implz"Connection._release_savepoint_impl<70>sG<00><00> <0F> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <10>M<EFBFBD>M<EFBFBD> +<2B> +<2B>D<EFBFBD>$<24><04> =<3D> <0C> <0B> <0B><1B><1B>0<>0<><14>t<EFBFBD><rwc<01><><00>|jr|jd<01>|js|jjr&|jj ||j <00>d|_ |jjj||j <00>d|_y#t$r}|j|dddd<00>Yd}~<02>+d}~wwxYw#d|_wxYw)NzBEGIN TWOPHASE (implicit)TF) r_rvrarUrKr<>r<>r[rI<00>do_begin_twophaser<65>r<>r<>s rg<00>_begin_twophase_implzConnection._begin_twophase_impl<70>s<><00><00> <0F>:<3A>:<3A> <10>N<EFBFBD>N<EFBFBD>6<> 7<> <0F> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <10>M<EFBFBD>M<EFBFBD> (<28> (<28><14>{<7B><EFBFBD><EFBFBD> ?<3F><1E><04><0F> $<24> <10>K<EFBFBD>K<EFBFBD> <1F> <1F> 1<> 1<>$<24> <0B><0F><0F> H<>$<24>D<EFBFBD>O<EFBFBD><4F><1D> D<01> <10> (<28> (<28><11>D<EFBFBD>$<24><04>d<EFBFBD> C<> C<><43> D<01><>$<24>D<EFBFBD>O<EFBFBD>s*<00>.0B&<00>& C<03>/C <03>C<00> C<03>C<00> Cc<01>\<00>|js|jjr|jj||<01>t |j
t <00>sJ<00> |jjj||<01>y#t$r}|j|dddd<00>Yd}~yd}~wwxYwr<>) rarUrK<00>prepare_twophase<73>
isinstancerQr<>rI<00>do_prepare_twophaser<65>r<>)rcr<>r<>s rg<00>_prepare_twophase_implz!Connection._prepare_twophase_impl<70>s<><00><00> <0F> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <10>M<EFBFBD>M<EFBFBD> *<2A> *<2A>4<EFBFBD><13> 5<><19>$<24>+<2B>+<2B>-@<40>A<>A<>A<> D<01> <10>K<EFBFBD>K<EFBFBD> <1F> <1F> 3<> 3<>D<EFBFBD>#<23> ><3E><><1C> D<01> <10> (<28> (<28><11>D<EFBFBD>$<24><04>d<EFBFBD> C<> C<><43> D<01>s<00>&B<00> B+<03> B&<03>&B+c<01>z<00>|js|jjr|jj|||<02>|jrEt |j t<00>sJ<00> |jjj|||<02>yy#t$r}|j|dddd<00>Yd}~yd}~wwxYwr<>) rarUrK<00>rollback_twophaser<65>rrQr<>rIr<>r<>r<><00>rcr<><00> is_preparedr<64>s rg<00>_rollback_twophase_implz"Connection._rollback_twophase_impl<70>s<><00><00> <0F> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <10>M<EFBFBD>M<EFBFBD> +<2B> +<2B>D<EFBFBD>#<23>{<7B> C<> <0F> 9<> 9<><1D>d<EFBFBD>/<2F>/<2F>1D<31>E<> E<>E<> H<01><14> <0B> <0B>#<23>#<23>8<>8<><18>#<23>{<7B><12> :<3A><> !<21> H<01><14>,<2C>,<2C>Q<EFBFBD><04>d<EFBFBD>D<EFBFBD>$<24>G<>G<><47> H<01>s<00>)'B<00> B:<03>B5<03>5B:c<01>`<00>|js|jjr|jj|||<02>t |j
t <00>sJ<00> |jjj|||<02>y#t$r}|j|dddd<00>Yd}~yd}~wwxYwr<>) rarUrK<00>commit_twophaserrQr<>rIr<>r<>r<>r!s rg<00>_commit_twophase_implz Connection._commit_twophase_impl<70>s<><00><00> <0F> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <10>M<EFBFBD>M<EFBFBD> )<29> )<29>$<24><03>[<5B> A<><19>$<24>+<2B>+<2B>-@<40>A<>A<>A<> D<01> <10>K<EFBFBD>K<EFBFBD> <1F> <1F> 2<> 2<>4<EFBFBD><13>k<EFBFBD> J<><4A><1C> D<01> <10> (<28> (<28><11>D<EFBFBD>$<24><04>d<EFBFBD> C<> C<><43> D<01>s<00>'B<00> B-<03>B(<03>(B-c<01><00>|jr|jj<00>d}nd}|j<00>B|j}|rtd|<02>j d<01><05>n|j<00>d|_d|_y)a<>Close this :class:`_engine.Connection`.
This results in a release of the underlying database
resources, that is, the DBAPI connection referenced
internally. The DBAPI connection is typically restored
back to the connection-holding :class:`_pool.Pool` referenced
by the :class:`_engine.Engine` that produced this
:class:`_engine.Connection`. Any transactional state present on
the DBAPI connection is also unconditionally released via
the DBAPI connection's ``rollback()`` method, regardless
of any :class:`.Transaction` object that may be
outstanding with regards to this :class:`_engine.Connection`.
This has the effect of also calling :meth:`_engine.Connection.rollback`
if any transaction is in place.
After :meth:`_engine.Connection.close` is called, the
:class:`_engine.Connection` is permanently in a closed state,
and will allow no further operations.
TFNr5)<01>transaction_reset)rQr<>rNr<00>_close_specialr\)rc<00>
skip_reset<EFBFBD>conns rgr<>zConnection.close<73>s<><00><00>. <10> <1C> <1C> <10> <1D> <1D> #<23> #<23> %<25><1D>J<EFBFBD><1E>J<EFBFBD> <0F> !<21> !<21> -<2D><17>)<29>)<29>D<EFBFBD><1A><14>'<27><14>.<2E>=<3D>=<3D>&*<2A>><3E><12><15>
<EFBFBD>
<EFBFBD> <0C> &*<2A>D<EFBFBD> "<22>$<24><04>rw<00>r<>c<01><00>yr<>r<><00>rc<00> statement<6E>
parametersr<EFBFBD>s rg<00>scalarzConnection.scalar<61>s<00><00>rwc<01><00>yr<>r<>r.s rgr1zConnection.scalar<61>s<00><00>rwc<01><><00>t|<02>} |j}||||xst<00>S#t$r}t j
|<01>|<06>d}~wwxYw)auExecutes a SQL statement construct and returns a scalar object.
This method is shorthand for invoking the
:meth:`_engine.Result.scalar` method after invoking the
:meth:`_engine.Connection.execute` method. Parameters are equivalent.
:return: a scalar Python value representing the first column of the
first row returned.
N)r<00>_execute_on_scalarrF<00>AttributeErrorr<00>ObjectNotExecutableError<6F>rcr/r0r<><00>distilled_parameters<72>methrfs rgr1zConnection.scalarsc<00><00>" 2<>*<2A>=<3D><1C> <0E><1C>/<2F>/<2F>D<EFBFBD><18><14>$<24>!<21>/<2F>Z<EFBFBD><0E> <0E><><1E> C<01><15>.<2E>.<2E>y<EFBFBD>9<>s<EFBFBD> B<><42> C<01><><00> +<00> A<03>A
<03>
Ac<01><00>yr<>r<>r.s rg<00>scalarszConnection.scalars<00><00><00>rwc<01><00>yr<>r<>r.s rgr<zConnection.scalars(<00><00><00> rwc<01>F<00>|j|||<03><01>j<00>S)a<>Executes and returns a scalar result set, which yields scalar values
from the first column of each row.
This method is equivalent to calling :meth:`_engine.Connection.execute`
to receive a :class:`_result.Result` object, then invoking the
:meth:`_result.Result.scalars` method to produce a
:class:`_result.ScalarResult` instance.
:return: a :class:`_result.ScalarResult`
.. versionadded:: 1.4.24
r,)<02>executer<r.s rgr<zConnection.scalars1s)<00><00>*<14>|<7C>|<7C> <15>z<EFBFBD>5F<35><1C>
<EFBFBD>
<11>'<27>)<29> rwc<01><00>yr<>r<>r.s rgrAzConnection.executeJr=rwc<01><00>yr<>r<>r.s rgrAzConnection.executeSr?rwc<01><><00>t|<02>} |j}||||xst<00>S#t$r}t j
|<01>|<06>d}~wwxYw)a<>Executes a SQL statement construct and returns a
:class:`_engine.CursorResult`.
:param statement: The statement to be executed. This is always
an object that is in both the :class:`_expression.ClauseElement` and
:class:`_expression.Executable` hierarchies, including:
* :class:`_expression.Select`
* :class:`_expression.Insert`, :class:`_expression.Update`,
:class:`_expression.Delete`
* :class:`_expression.TextClause` and
:class:`_expression.TextualSelect`
* :class:`_schema.DDL` and objects which inherit from
:class:`_schema.ExecutableDDLElement`
:param parameters: parameters which will be bound into the statement.
This may be either a dictionary of parameter names to values,
or a mutable sequence (e.g. a list) of dictionaries. When a
list of dictionaries is passed, the underlying statement execution
will make use of the DBAPI ``cursor.executemany()`` method.
When a single dictionary is passed, the DBAPI ``cursor.execute()``
method will be used.
:param execution_options: optional dictionary of execution options,
which will be associated with the statement execution. This
dictionary can provide a subset of the options that are accepted
by :meth:`_engine.Connection.execution_options`.
:return: a :class:`_engine.Result` object.
N)r<00>_execute_on_connectionrFr5rr6r7s rgrAzConnection.execute\sd<00><00>L 2<>*<2A>=<3D><1C> <0E><1C>3<>3<>D<EFBFBD><18><14>$<24>!<21>/<2F>Z<EFBFBD><0E> <0E><><1E> C<01><15>.<2E>.<2E>y<EFBFBD>9<>s<EFBFBD> B<><42> C<01>r:c<01>D<00>|j|j<00>||<03>S)z%Execute a sql.FunctionElement object.)<02>_execute_clauseelement<6E>select)rc<00>funcr8r<>s rg<00>_execute_functionzConnection._execute_function<6F>s&<00><00><14>*<2A>*<2A> <10>K<EFBFBD>K<EFBFBD>M<EFBFBD>/<2F>1B<31>
<EFBFBD>
rwc<01><><00>|jj|<03>}|js|jjr|j |||<03>\}}}}ndx}} |j
}|<06>|j <00>}|j}|jj||||<03>}jd|d<01>}
|js|jjr |j j#||||||
<EFBFBD>|
S#tjtjf$r<00>t$r} |j| dddd<01>Yd} ~ <09><>d} ~ wwxYw)z&Execute a schema.ColumnDefault object.N)rO<00>
merge_withrarU<00>_invoke_before_exec_eventrNr<>rI<00>execution_ctx_cls<6C> _init_defaultrr<>r<>r<>r<><00> _exec_defaultrK<00> after_execute) rc<00>defaultr8r<><00>event_multiparams<6D> event_paramsr+rI<00>ctxr<78><00>rets rg<00>_execute_defaultzConnection._execute_default<6C>sX<00><00>!<21>3<>3<>><3E>><3E> <1D>
<EFBFBD><19> <10> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <15>.<2E>.<2E><17>-<2D>/@<40><0E>  <0E><17>$<24>!<21><1C>
04<30> 3<> <1D> <0C> D<01><17>)<29>)<29>D<EFBFBD><13>|<7C><1B>2<>2<>4<><04><1A>l<EFBFBD>l<EFBFBD>G<EFBFBD><19>+<2B>+<2B>9<>9<><17><14>t<EFBFBD>%6<><0E>C<EFBFBD><12><1F><1F><04>g<EFBFBD>t<EFBFBD>4<><03> <0F> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <10>M<EFBFBD>M<EFBFBD> '<27> '<27><14><17>!<21><1C>!<21><13>  <0E><13>
<EFBFBD><EFBFBD>#<14>(<28>(<28>#<23>*A<>*A<>B<> <12> <11><1C> D<01> <10> (<28> (<28><11>D<EFBFBD>$<24><04>d<EFBFBD> C<> C<><43> D<01>s<00>AC;<00>;,E<03>'E<03>Ec<01>
<00>|jj|j|<03>}|js|jjr|j |||<04>\}}}}ndx}}|j dd<01>}|j }|j||<07><03>} |j||jj| d|| <09>}
|js|jjr |jj||||||
<EFBFBD>|
S)zExecute a schema.DDL object.Nr|)rIr|) rOrLrarUrMr}rI<00>compile<6C>_execute_contextrN<00> _init_ddlrKrQ) rc<00>ddlr8r<><00> exec_optsrSrTr|rI<00>compiledrVs rg<00> _execute_ddlzConnection._execute_ddl<64>s<00><00><18>*<2A>*<2A>5<>5<> <10> #<23> #<23>%6<>
<EFBFBD> <09> <10> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <15>.<2E>.<2E><13>)<29>9<EFBFBD><0E>  <0E><13>$<24>!<21><1C>
04<30> 3<> <1D> <0C>(<28>}<7D>}<7D>-C<>T<EFBFBD>J<><1C><16>,<2C>,<2C><07><16>;<3B>;<3B><1B>2F<32><1F>
<EFBFBD><08><13>#<23>#<23> <13> <13> %<25> %<25> /<2F> /<2F> <14> <10> <15> <14> 
<EFBFBD><03> <10> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <10>M<EFBFBD>M<EFBFBD> '<27> '<27><14><13>!<21><1C><19><13>  <0E><13>
rwc<01><><00>t|<02>dk(rg|d}}n|i}}|jjD]}||||||<03>\}}}<05>|r"t|<04>}|rt j
d<03><00>|r|g}ng}||||fS)NrrzLEvent handler can't return non-empty multiparams and params at the same time)<06>lenrK<00>before_execute<74>listrr<>)rc<00>elem<65>distilled_paramsr<73>rSrT<00>fns rgrMz$Connection._invoke_before_exec_event
s<><00><00> <0F><1F> <20>A<EFBFBD> %<25>.0<EFBFBD>2B<EFBFBD>1<EFBFBD>2E<EFBFBD>|<7C> <1D>.><3E><02>|<7C> <1D><16>-<2D>-<2D>.<2E>.<2E>B<EFBFBD>46<34><14><14>!<21><1C>!<21> 5<0E> 1<>D<EFBFBD>#<23>\<5C>/<2F> <1D>#<23>$5<>6<> <1C><1B><19>-<2D>-<2D>2<><12><12><1A> ,<2C>~<7E> <1C>!<21> <1C><13>%<25>'8<>,<2C>F<>Frwc <01><><00>|jj|j|<03>}|jxs|jj}|r|j |||<03>\}}}}|rt |d<00>}t |<02>dkD}ng}d}|j} |jdd<05>}
|jd|jj<00>} |j| | |||
|jjtjz<00><07>\} } }|j| | jj | ||| ||| |<0E><08>
}|r |j"j%||||<0F>|S) z#Execute a sql.ClauseElement object.rrFr|Nr<4E>)rIr<><00> column_keys<79>for_executemanyr|<00>linting)<01> cache_hit)rOrLrarUrM<00>sortedrarIr}<00>_compiled_cache<68>_compile_w_cache<68>compiler_lintingr"<00> WARN_LINTINGrZrN<00>_init_compiledrKrQ)rcrdr8r<><00>
has_eventsrSrT<00>keysrirIr|r<><00> compiled_sql<71>extracted_paramsrkrVs rgrGz!Connection._execute_clauseelement4s<><00><00>!<21>3<>3<>><3E>><3E> <10> #<23> #<23>%6<>
<EFBFBD><19><1A>%<25>%<25>@<40><14><1B><1B>)@<40>)@<40>
<EFBFBD> <15> <15>.<2E>.<2E><14>*<2A>,=<3D><0E>  <0E><14>$<24>!<21><1C>
<20><1A>.<2E>q<EFBFBD>1<>2<>D<EFBFBD>!<21>"6<>7<>!<21>;<3B>O<EFBFBD><15>D<EFBFBD>#<23>O<EFBFBD><16>,<2C>,<2C><07>0<>4<>4<> "<22>D<EFBFBD>
<EFBFBD><1C>7H<01>6K<36>6K<36> <1C>d<EFBFBD>k<EFBFBD>k<EFBFBD>9<>9<>7
<EFBFBD><0E>59<35>4I<34>4I<34><1B>)<29><1C>+<2B>!5<><18>L<EFBFBD>L<EFBFBD>1<>1<>H<EFBFBD>4I<34>4I<34>I<> 5J<01>5
<EFBFBD>1<> <0C>&<26> <09><13>#<23>#<23> <13> <13> %<25> %<25> 4<> 4<> <18> <20> <1D> <18> <20> <10> <1C><1F>$<24> 
<EFBFBD><03> <16> <10>M<EFBFBD>M<EFBFBD> '<27> '<27><14><14>!<21><1C>!<21><13>  <0E><13>
rwc <01><><00>|jj|j|<03>}|js|jjr|j |||<03>\}}}}|j }|j||jj|||||dd<01> }|js|jjr |jj||||<07>|S)ziExecute a sql.Compiled object.
TODO: why do we have this? likely deprecate or remove
N) r<>rLrOrarUrMrIrZrNrqrKrQ)rcr^r8r<>rSrTrIrVs rg<00>_execute_compiledzConnection._execute_compiled}s<><00><00>%<25>6<>6<>A<>A<> <10> #<23> #<23>%6<>
<EFBFBD><19> <10> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <15>.<2E>.<2E><18>.<2E>0A<30><0E>  <0E><18>$<24>!<21><1C>
<17>,<2C>,<2C><07><12>#<23>#<23> <13> <13> %<25> %<25> 4<> 4<> <14> <20> <1D> <14> <20> <10> <10>

<EFBFBD><03> <10> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <10>M<EFBFBD>M<EFBFBD> '<27> '<27><14><18>!<21><1C>!<21><13>  <0E><13>
rwc <01><><00>t|<02>}|jj|<03>}|j}|j ||j
j |d|||<04>}|S)aLExecutes a string SQL statement on the DBAPI cursor directly,
without any SQL compilation steps.
This can be used to pass any string directly to the
``cursor.execute()`` method of the DBAPI in use.
:param statement: The statement str to be executed. Bound parameters
must use the underlying DBAPI's paramstyle, such as "qmark",
"pyformat", "format", etc.
:param parameters: represent bound parameter values to be used in the
execution. The format is one of: a dictionary of named parameters,
a tuple of positional parameters, or a list containing either
dictionaries or tuples for multiple-execute support.
:return: a :class:`_engine.CursorResult`.
E.g. multiple dictionaries::
conn.exec_driver_sql(
"INSERT INTO table (id, value) VALUES (%(id)s, %(value)s)",
[{"id": 1, "value": "v1"}, {"id": 2, "value": "v2"}],
)
Single dictionary::
conn.exec_driver_sql(
"INSERT INTO table (id, value) VALUES (%(id)s, %(value)s)",
dict(id=1, value="v1"),
)
Single tuple::
conn.exec_driver_sql(
"INSERT INTO table (id, value) VALUES (?, ?)", (1, "v1")
)
.. note:: The :meth:`_engine.Connection.exec_driver_sql` method does
not participate in the
:meth:`_events.ConnectionEvents.before_execute` and
:meth:`_events.ConnectionEvents.after_execute` events. To
intercept calls to :meth:`_engine.Connection.exec_driver_sql`, use
:meth:`_events.ConnectionEvents.before_cursor_execute` and
:meth:`_events.ConnectionEvents.after_cursor_execute`.
.. seealso::
:pep:`249`
N)rrOrLrIrZrN<00>_init_statement)rcr/r0r<>r8rIrVs rg<00>exec_driver_sqlzConnection.exec_driver_sql<71>sm<00><00>t 3<>:<3A>><3E><1C> <20>3<>3<>><3E>><3E> <1D>
<EFBFBD><19><17>,<2C>,<2C><07><12>#<23>#<23> <13> <13> %<25> %<25> 5<> 5<> <15> <10> <1D> <15> <20>
<EFBFBD><03><13>
rwc<01>*<00>|r(|jdd<02>}|r|jd|d<04><02>} |j} | <09>|j<00>} |||| |g|<06><01>i|<07><01>}
|jr|jjr"|jr'|jjs|j<00>n!|jrtj |<00>|j<00>|j#<00>
j%<00>|
j&t(j*ur|j-||
<EFBFBD>S|j/||
||<04>S#tj
tj f$r<00>t$r)} |j| t|<03>|dd<02>Yd} ~ <0B><01>4d} ~ wwxYw)zdCreate an :class:`.ExecutionContext` and execute, returning
a :class:`_engine.CursorResult`.r<>NT)r<>r<>)r}r<>rNr<>rr<>r<>r<>r<><00>strrQr<>rSr<>rLr<00>_trans_ctx_checkr<6B><00>pre_exec<65> execute_styler<00>INSERTMANYVALUES<45>_exec_insertmany_context<78>_exec_single_context) rcrI<00> constructorr/r0r<><00>argsrt<00>ypr+<00>contextr<74>s rgrZzConnection._execute_context<78>s<><00><00> <1D>"<22>&<26>&<26>{<7B>D<EFBFBD>9<>B<EFBFBD><11>$5<>$;<3B>$;<3B>'+<2B>r<EFBFBD>B<>%<12>!<21> <0E><17>)<29>)<29>D<EFBFBD><13>|<7C><1B>2<>2<>4<><04>!<21><17><14>t<EFBFBD>%6<><0E>9=<3D><0E>AC<41><0E>G<EFBFBD> <11> <1D> <1D><18>%<25>%<25>/<2F>/<2F><14>(<28>(<28><1C>0<>0<>:<3A>:<3A> <11> %<25> %<25> '<27> <11> (<28> (<28> <20> 1<> 1<>$<24> 7<> <0F> <1C> <1C> $<24> <10>O<EFBFBD>O<EFBFBD> <1D><0F><18><18><1A> <12> <20> <20>L<EFBFBD>$A<>$A<> A<><17>0<>0<><17>'<27>B<> B<><17>,<2C>,<2C><17><17>)<29>Z<EFBFBD><0E> <0E><>9<14>(<28>(<28>#<23>*A<>*A<>B<> <12> <11><1C> <0E> <10> (<28> (<28><11>3<EFBFBD>y<EFBFBD>><3E>:<3A>t<EFBFBD>T<EFBFBD> <0E> <0E><> <0E>s<00>-D=<00>=,F<03>)F <03> Fc <01>p<00>|jtjur0|j<00>}|r |j |j
||<02>|j
|j|j}}}|js|d} n|} |js|jjr5|jjD]}
|
|||| ||j<00>\}} <09>|j r}|j#|<08>|j%<00>} |jj&s4|j#d| t)j*| d|j<00><05><00>n|j#d| <0B>d} |j,t.j0urxt3d| <09>} |j4jr4|j4jj6D]}
|
||| |<02>s<01>d } n| <0C>s |j4j7||| |<02>n<>| su|j8ri|j4jr3|j4jj:D]}
|
|||<02>s<01>d } n| s<>|j4j;|||<02>nvt3d
| <09>} |j4jr4|j4jj<D]}
|
||| |<02>s<01>d } n| s|j4j=||| |<02>|js|jjr*|jj?|||| ||j<00>|jA<00>|jC<00>} | S#t $r)}|j|t|<03>|d|<02>Yd}~<06><03>7d}~wwxYw#t $r }|j||| ||<02>Yd}~ Sd}~wwxYw) zzcontinue the _execute_context() method for a single DBAPI
cursor.execute() or cursor.executemany() call.
Nr<00>[%s] %r<>
<00><02>batches<65>ismulti<74>8[%s] [SQL parameters hidden due to hide_parameters=True]Fr(Tr))"<22> bind_typingr<00> SETINPUTSIZES<45>_prepare_set_input_sizes<65>do_set_input_sizes<65>cursorr<72>r<>r|r/r0<00> executemanyrarUrK<00>before_cursor_executer_rv<00>_get_cache_stats<74>hide_parameters<72>sql_util<69> _repr_paramsrr<00> EXECUTEMANYrrI<00>do_executemanyr<79><00>do_execute_no_params<6D>
do_execute<EFBFBD>after_cursor_execute<74> post_exec<65>_setup_result_proxy)rcrIr<>r/r0<00>generic_setinputsizesr<73>r<><00> str_statement<6E>effective_parametersrf<00>stats<74> evt_handled<65>results rgr<>zConnection._exec_single_context7s<><00><00> <13> <1E> <1E>*<2A>":<3A>":<3A> :<3A>$+<2B>$D<>$D<>$F<> !<21>$<24><16><1B>.<2E>.<2E><1F><0E><0E>(=<3D>w<EFBFBD><16> <14>N<EFBFBD>N<EFBFBD> <13> <1D> <1D> <13> <1E> <1E> *<2A> <0A><06><17>"<22>"<22>#-<2D>a<EFBFBD>=<3D> <20>#-<2D> <20> <0F> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<><1A>m<EFBFBD>m<EFBFBD>9<>9<><02>68<36><18><1A>!<21>(<28><1B><1B>'<27>'<27> 7<12>3<> <0A>3<>:<3A> <10>:<3A>:<3A> <10>N<EFBFBD>N<EFBFBD>=<3D> )<29><1B>,<2C>,<2C>.<2E>E<EFBFBD><17>;<3B>;<3B>.<2E>.<2E><14><0E><0E><1D><19><1C>)<29>)<29>,<2C> "<22> '<27> 3<> 3<><16><12><15><0E><0E>N<><19><12>
"<22> <0B>D <0E><16>$<24>$<24> <0C>(@<40>(@<40>@<40>'+<2B>-<2D>/C<>(<12>$<24><18><<3C><<3C>+<2B>+<2B>"<22>l<EFBFBD>l<EFBFBD>3<>3<>B<>B<><02><1D>"<22>)<29>0<>#<23> <1A> +/<2F>K<EFBFBD>!<21>C<01>#<23><18>L<EFBFBD>L<EFBFBD>/<2F>/<2F><1E>%<25>,<2C><1F> <16> *<2A>g<EFBFBD>.C<>.C<><17><<3C><<3C>+<2B>+<2B>"<22>l<EFBFBD>l<EFBFBD>3<>3<>H<>H<><02><1D>f<EFBFBD>m<EFBFBD>W<EFBFBD>=<3D>*.<2E>K<EFBFBD>!<21>I<01>#<23><18>L<EFBFBD>L<EFBFBD>5<>5<><1E> <0A>w<EFBFBD><16>(,<2C>.<2E>0D<30>(<12>$<24><18><<3C><<3C>+<2B>+<2B>"<22>l<EFBFBD>l<EFBFBD>3<>3<>><3E>><3E><02><1D>"<22>)<29>0<>#<23> <1A> +/<2F>K<EFBFBD>!<21>?<3F>#<23><18>L<EFBFBD>L<EFBFBD>+<2B>+<2B><1E> <0A>/C<>W<EFBFBD><16><14><1F><1F>4<EFBFBD>;<3B>;<3B>#:<3A>#:<3A><14> <0A> <0A>2<>2<><18><1A>!<21>(<28><1B><1B>'<27>'<27> <12> <14> <1D> <1D> <1F><1C>0<>0<>2<>F<EFBFBD><16> <0A><>s%<25><16><18>0<>0<><19>3<EFBFBD>y<EFBFBD>><3E>:<3A>t<EFBFBD>W<EFBFBD><16><16><><16><>h<1D> <0E> <10> (<28> (<28><11>=<3D>"6<><06><07> <0E> <0E><16> <0A><>  <0E>sE<00>M<00>(A,N <00>A8N <00>A5N <00>BN <00> N <03> N<03>N <03> N5<03>N0<03>0N5c
<01>j<00>|jtjur|j<00>}nd}|j|j
|j }}}|}|jxs|jj}|jjr!|jjj} nd} |jr|j<00>dz}
|jjdd<05>} d} |j!||||||<02>D<00>]<5D>} | j"r( |j%|j| j"|<02>| j.}| j0}|r+|jj2D]}||||||d<07>\}}<10>|jr<>|j5t+j,|<0F><00>d | j6<00>d
| j8<00>d | j:rd nd <0A>| j<rdnd<0F>d<10>}| j6dk(r
|z }
nd|<12><00>}
|jj>s*|j5d|
t+j@|dd<05><15><00>n|j5d|
<EFBFBD> | D]}|||||<02>s<01>n|j||||<02>|r*|jjC||||||jD<00>| s<02><01><>| | jFz } <0C><01><> |jI<00>| r| |_%|jM<00>}|S#t&$rI}|j)|t+j,| j.<00>| j0d|d<07><08>Yd}~<0E><02>d}~wwxYw#t&$r4}|j)|t+j,|<0F>|||d<07><08>Yd}~<0E><>d}~wwxYw#t&$r }|j)|||||<02>Yd}~Sd}~wwxYw)z<>continue the _execute_context() method for an "insertmanyvalues"
operation, which will invoke DBAPI
cursor.execute() one or more times with individual log and
event hook calls.
Nr<4E>z (insertmanyvalues)r<>FrT)<01> is_sub_exec<65> <20>/z (<28>ordered<65> unorderedz; batch not supportedr<64><00>)r<00>insertmanyvaluesr<73>r<>r<>r<>)'r<>rr<>r<>r<>r/r0rarUrIrKr<>r_r<>r<>r}<00>!_deliver_insertmanyvalues_batches<65>processed_setinputsizesr<73>r<>r<>r<><00>_long_statement<6E>replaced_statement<6E>replaced_parametersr<73>rv<00>batchnum<75> total_batches<65> rows_sorted<65> is_downgradedr<64>r<>r<>r<><00>current_batch_sizer<65><00> _rowcountr<74>)rcrIr<>r<>r<>r<>r0r<><00> engine_events<74>do_execute_dispatchr<68>r<><00>rowcount<6E> imv_batchr<68><00>sub_stmt<6D>
sub_paramsrf<00> imv_statsr<73>s rgr<>z#Connection._exec_insertmany_context<78>s<00><00> <13> <1E> <1E>*<2A>":<3A>":<3A> :<3A>$+<2B>$D<>$D<>$F<> !<21>$(<28> !<21> <14>N<EFBFBD>N<EFBFBD> <13> <1D> <1D> <13> <1E> <1E> *<2A> <0A><06> *<2A><1C><1C>(<28>(<28>C<>D<EFBFBD>K<EFBFBD>K<EFBFBD>,C<>,C<> <0A> <0F><<3C><<3C> #<23> #<23><14> <0C> <0C>%<25>%<25>0<>0<> <20>#%<25> <1F> <0F>:<3A>:<3A><1B>,<2C>,<2C>.<2E>1F<31>F<>E<EFBFBD>#<23>5<>5<>9<>9<> <1F><15>
<EFBFBD><19><15><08> <20>B<>B<> <10> <12> <19> <20> !<21> <13> 
<EFBFBD>I<EFBFBD><19>0<>0<><16><1B>.<2E>.<2E><1F><0E><0E>!<21>9<>9<><1F><16>!<21>3<>3<>H<EFBFBD>"<22>6<>6<>J<EFBFBD><1C><1E>-<2D>-<2D>=<3D>=<3D>B<EFBFBD>+-<2D><1C><1E> <20>"<22><1F><1C> ,<16>(<28>H<EFBFBD>j<EFBFBD>><3E><14>z<EFBFBD>z<EFBFBD><14><0E><0E>x<EFBFBD>7<>7<><08>A<>B<> !<21>)<29>"4<>"4<>!5<>Q<EFBFBD>%<25>3<>3<>7<12><13> <20>,<2C>,<2C><1E>2=<3D><12>
!<21>.<2E>.<2E>,<2C><1B><12><13> <16> <09><1D>%<25>%<25><11>*<2A><19>Y<EFBFBD>&<26>E<EFBFBD>.<2E>y<EFBFBD>k<EFBFBD>:<3A>E<EFBFBD><1B>{<7B>{<7B>2<>2<><18>N<EFBFBD>N<EFBFBD>!<21><1D> <20>-<2D>-<2D>&<26>$&<26>$)<29><1A><16><19>N<EFBFBD>N<EFBFBD>0<><1D><16>  <12>-<2D>B<EFBFBD><19><1E> <20>"<22><1F> <16> <1E>.<2E><1C>&<26>&<26><1E> <20>"<22><1F> <16>"<1D><14> <0A> <0A>2<>2<><18><1A>!<21>(<28><1B><1B>'<27>'<27> <12>!<21><18>I<EFBFBD>8<>8<>8<><08>c
<EFBFBD>f <0E> <13> <1D> <1D> <1F> <20>$,<2C><07>!<21><1C>0<>0<>2<>F<EFBFBD><16> <0A><>c%<25><16><18>0<>0<><19> <20>0<>0<><19>1M<31>1M<31>N<>!<21>5<>5<><1C><1F>$(<28> 1<><16><16><><16><>Z!<21> <12><14>,<2C>,<2C><15><1C>,<2C>,<2C>X<EFBFBD>6<><1E><1A><1B> $<24> -<2D><12><12><> <12><>><1D> <0E> <10> (<28> (<28><11>=<3D>"6<><06><07> <0E> <0E><16> <0A><>  <0E>sN<00>'K4<02>M <02>/M <02> )N <00>4 M<05>=>M<05>M<05> N<05>*N<05>N<05> N2<03>N-<03>-N2c <01><><00>|js|jjr+|jjD]}||||||d<01>\}}<03>|jr#|j |<02>|j d|<03> |j jsdn|j jjD]}|||||<04>s<01>n|j j||||<04>|js|jjr!|jj|||||d<01>yy#t$r}|j|||||<04>Yd}~<06>gd}~wwxYw)a_Execute a statement + params on the given cursor.
Adds appropriate logging and exception handling.
This method is used by DefaultDialect for special-case
executions, such as for sequences and column defaults.
The path of statement execution in the majority of cases
terminates at _execute_context().
Fz [raw sql] %rr<72>N) rarUrKr<>r_rvrIr<>r<>r<>r<>)rcr<>r/r0r<>rfr<>s rg<00>_cursor_executezConnection._cursor_executeps?<00><00>" <10> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<><1A>m<EFBFBD>m<EFBFBD>9<>9<><02>(*<2A><18>&<26>)<29>Z<EFBFBD><17>%<25>)<12>%<25> <09>:<3A>:<3A>
<10>:<3A>:<3A> <10>N<EFBFBD>N<EFBFBD>9<EFBFBD> %<25> <10>N<EFBFBD>N<EFBFBD>><3E>:<3A> 6<> <0E><1C>|<7C>|<7C>/<2F>/<2F><13><19>\<5C>\<5C>*<2A>*<2A>5<>5<>6<><13>
<16>f<EFBFBD>i<EFBFBD><1A>W<EFBFBD>=<3D><19> 6<><15> <0C> <0C>'<27>'<27><06> <09>:<3A>w<EFBFBD>O<> <10> <1B> <1B>t<EFBFBD>{<7B>{<7B>6<>6<> <10>M<EFBFBD>M<EFBFBD> .<2E> .<2E><14>f<EFBFBD>i<EFBFBD><1A>W<EFBFBD>e<EFBFBD> <0E> 7<><37> <1D> <0E> <10> (<28> (<28><11>9<EFBFBD>j<EFBFBD>&<26>'<27> <0E> <0E><> <0E>s<00>>AD*<00>!D*<00>* E<03>3E <03> Ec<01><><00> |j<00>y#t$r4|jjjj dd<02><03>YywxYw)z\Close the given cursor, catching exceptions
and turning into log warnings.
zError closing cursorT)<01>exc_infoN)r<><00> ExceptionrU<00>poolro<00>error)rcr<>s rg<00>_safe_close_cursorzConnection._safe_close_cursor<6F>sG<00><00>
 <0E> <12>L<EFBFBD>L<EFBFBD>N<EFBFBD><4E><18> <0E> <10>K<EFBFBD>K<EFBFBD> <1C> <1C> #<23> #<23> )<29> )<29>&<26><14> *<2A> <0E> <0E>s<00><00>:A<03>Ac<01>Z<00>tj<00>}tj|<01>}|js<>t ||j jj<00>xrD|j xr5|j j||js |jnd|<04>xs|xr |j |_| } |<05>| xr|jnd}
|jrutj j#||||j jj|j$j&|j |
<EFBFBD><02>j)|d<00>|<01>d|_ t ||j jj<00>xs|duxr |duxr| } | r|tj j#||t+t,|<01>|j jj|j$j&|j|j |
<EFBFBD><05>} nd} d} |j j.r<>|j0j3dd<01>s<>t5|| |j$|j ||||||j| d<01> }|j j6j8D]} ||<0E>}|<10> |x|_} <0A>|j|jk7r$|j|_| r|j| _|j>} | r|r|jA|<01>|js3|r|jC|<04>|jE<00>s|jG<00>| r| j)|d<00>|<01>| r| <0C>J<00>| j)|d<00>|<01>|d<00>J<00>|dj)|d<00><00>#t,$r }|} Yd}~<00><>d}~wwxYw#|`|jrY|`|jsJ|j}|<12>J<00>| r&|j$jHjK||<01>|jM|<01>wwwxYw)NF)r<>rIr<>rT)r<><00>connection_invalidatedrIr<><00>skip_user_error_eventsr)'<27>sysr<73>r!<00>is_exit_exception<6F>_is_disconnectrrIrWrXr<><00> is_disconnectr<74>rNr<><00>_reentrant_errorr<00>
DBAPIError<EFBFBD>instancerUr<><00>with_tracebackrr<>rarOr}<00>ExceptionContextImplrK<00> handle_error<6F>chained_exceptionr<6E><00>invalidate_pool_on_disconnect<63>handle_dbapi_exceptionr<6E>r<>rr<><00> _invalidater<65>)rcr<>r/r0r<>r<>r<>r<>r<>r<>r<><00> should_wrap<61>sqlalchemy_exception<6F>newraiserUrf<00>per_fn<66>_raised<65>dbapi_conn_wrappers rgr<>z"Connection._handle_dbapi_exception<6F>s!<00><00><17><<3C><<3C>><3E><08> <20>2<>2<>1<EFBFBD>5<><19><13>"<22>"<22><1A>1<EFBFBD>d<EFBFBD>l<EFBFBD>l<EFBFBD>7<>7<>=<3D>=<3D>><3E><12><1C> <0B> <0B>O<EFBFBD><12><18>L<EFBFBD>L<EFBFBD>.<2E>.<2E><15>26<32>2B<32>2B<32>D<EFBFBD>*<2A>*<2A><04><1A><12>#9<>$<24>7<>D<EFBFBD>K<EFBFBD>K<EFBFBD><0F> <11> <1F>-><3E>(=<3D>%<25><17>"<22><1C>O<EFBFBD> 3<><07> 3<> 3<><16> <10>
<10> <20> <20><15>.<2E>.<2E>)<29>)<29><19><1A><11><14> <0C> <0C>)<29>)<29>/<2F>/<2F> $<24> <0B> <0B> ;<3B> ;<3B><1C> <0C> <0C><1F>*<2A><0E><1D>n<EFBFBD>X<EFBFBD>a<EFBFBD>[<5B>)<29>q<EFBFBD> 1<>!%<25><04><1D>e '<27>%<25>Q<EFBFBD><04> <0C> <0C>(A<>(A<>(G<>(G<>H<><0E><19><14>%<25>*<2A><1B>t<EFBFBD>O<EFBFBD>*<2A>)<29>)<29> <18> <1B>'*<2A>~<7E>~<7E>'><3E>'><3E><1D><1E><18><19>A<EFBFBD>&<26><18>L<EFBFBD>L<EFBFBD>-<2D>-<2D>3<>3<>$(<28>K<EFBFBD>K<EFBFBD>$?<3F>$?<3F>+/<2F>+><3E>+><3E> <20>L<EFBFBD>L<EFBFBD>#<23>(?<3F> (<12>$<24>(,<2C>$<24><1B>H<EFBFBD><14> <0C> <0C>(<28>(<28>$<24>2I<32>2I<32>2M<32>2M<32>(<28>%<25>3<0E>+<2B><15>(<28><18>K<EFBFBD>K<EFBFBD><18>L<EFBFBD>L<EFBFBD><18><1A><1D><1E><1B><18>'<27>'<27>1<><19> <12><03><1F>,<2C>,<2C>/<2F>/<2F><<3C><<3C>B<EFBFBD> <1E>"$<24>C<EFBFBD><17><06>!<21>-<2D>?E<>E<>C<EFBFBD>1<>H<EFBFBD><48> =<3D><18>&<26>&<26>#<23>*;<3B>*;<3B>;<3B>*-<2D>*;<3B>*;<3B>D<EFBFBD>'<27>+<2B><1F>-<2D>-<2D>-<2D>C<><18>5<>5<>.<2E><1B>w<EFBFBD><17>.<2E>.<2E>q<EFBFBD>1<><17>&<26>&<26><19><18>+<2B>+<2B>F<EFBFBD>3<><1C>*<2A>*<2A>,<2C><18>'<27>'<27>)<29><17><1E>-<2D>-<2D>h<EFBFBD>q<EFBFBD>k<EFBFBD>:<3A><01>A<><1C>+<2B>7<>7<>7<>*<2A>9<>9<>(<28>1<EFBFBD>+<2B>F<>A<EFBFBD>M<><1F><01>{<7B>.<2E>.<2E>.<2E><1E>q<EFBFBD>k<EFBFBD>0<>0<><18>!<21><1B>=<3D>=<3D><>S%<25><1E>#*<2A><08><1D><><1E><>V<15>%<25><13>"<22>"<22><18>'<27><1B>'<27>'<27>)-<2D>)?<3F>)?<3F>&<26>-<2D>9<>9<>9<>4<><1C> <0B> <0B>(<28>(<28>4<>4<>5G<35><11>K<><18>O<EFBFBD>O<EFBFBD>A<EFBFBD>&<26> (<28>#<23>s9<00>EO<00>&N(<02>9C/O<00>( N><05>1N9<05>3O<00>9N><05>>O<00>A)P*c<01>N<00>tj<00>}|<04>5t||jj<00>xr|j |dd<00>}t||jj<00>}|rWt jjddtt|<01>|jj|<03> |jnd||<02><02>} nd} d}
|jrit|| ||ddddd|||<06> } |jjD]} | | <0B>} | <0A> | x| _}
<EFBFBD>| r"|| j
k7r| j
x| _}|
r|
j%|d<00>|<01>|r| <09>J<00>| j%|d<00>|<01>|d<00>J<00>|dj%|d<00><00>#t$r }|}
Yd}~<00><>d}~wwxYw)NF)r<>r<>rIrr)r<>r<>rrWrXr<>rr<>r<>rr<>r<>rar<>rKr<>r<>r<>r<>)<0F>clsr<73>rIrUr<>r<><00> is_pre_pingr<67>r<>r<>r<>rUrfr<>r<>s rgrYz/Connection._handle_dbapi_exception_noconnection? s<><00><00><17><<3C><<3C>><3E><08> <18> <20>&<26><11>7<EFBFBD>'<27>'<27>-<2D>-<2D><0E>7<><19>'<27>'<27><01>4<EFBFBD><14>6<> <1A>!<21><11>G<EFBFBD>$8<>$8<>$><3E>$><3E>?<3F> <0B> <16>#&<26>><3E>><3E>#:<3A>#:<3A><14><14><14>Y<EFBFBD><01>"<22><17>$<24>$<24>*<2A>*<2A>.4<EFBFBD>.@<40>F<EFBFBD>*<2A>*<2A>e<EFBFBD>'4<><1F>$;<3B>
$<0E> <20>$(<28> <20><17><08> <12> <1E> <1E>&<26><11>$<24><16><17><14><14><14><14><14><1D>-<2D><1B> <0E>C<EFBFBD><1E>&<26>&<26>3<>3<><02> <1A> <20><03>W<EFBFBD>F<EFBFBD><1D>)<29>;A<>A<><03>-<2D><08><> 4<>$<24> <0A><13>9J<39>9J<39>(J<><17>%<25>%<25><12>$<24>;<3B>m<EFBFBD> <14><1A>)<29>)<29>(<28>1<EFBFBD>+<2B>6<>A<EFBFBD> =<3D> <18>'<27>3<> 3<>3<>&<26>5<>5<>h<EFBFBD>q<EFBFBD>k<EFBFBD>B<><01> I<><1B>A<EFBFBD>;<3B>*<2A> *<2A>*<2A><1A>1<EFBFBD>+<2B>,<2C>,<2C>X<EFBFBD>a<EFBFBD>[<5B>9<> 9<><39>#!<21><1A>&<26>H<EFBFBD><19><><1A>s<00>F<02> F$<05>F<05>F$c <01>J<00>||j|fi|<03><01>j|<02>y)z<>run a DDL visitor.
This method is only here so that the MockConnection can change the
options given to the visitor so that "checkfirst" is skipped.
N)rI<00>traverse_single)rc<00>visitorcallable<6C>element<6E>kwargss rg<00>_run_ddl_visitorzConnection._run_ddl_visitor<6F> s"<00><00> <18><04> <0C> <0C>d<EFBFBD>5<>f<EFBFBD>5<>E<>E<>g<EFBFBD>Nrw)NNTT)
rU<00>EnginerdrMra<00>Optional[bool]rer<>r]r<>)rrr|rsrrtr<00>return<72>None)r<><00> Optional[SchemaTranslateMapType])r<>r@r<><00> Optional[str]<5D>r<>rH)r<>rr<>rr<>rr<>r<>)r<><00>Optional[CompiledCacheType]r<>r|r<>rr<>r<>r<>r<>r<><00>intr<74>r<>r<>r<>r|r<>r<>r<>r<>rr<>rH)r<>rr<>rH<00>r<>r,<00>r<>r<><00>r<>r7)r<>r)r<>zOptional[IsolationLevel])r<>r )r<>r9r<>)r<>zOptional[BaseException]r<>r<><00>r<>r<>)r<>r<>)r<>r<>)r<>z Optional[Any]r<>r<>)r<>z List[Any]<5D>F)r<>rr<>r<>r<>r<>)r<>rP)r<>rR)rr<>r<>r<>)r<>r<>r<>r|)r<>r|r<>r<>)rr<>r<>r<>)r<>rr<>r<>)r<>rr"r<>r<>r<>)r/<00>TypedReturnsRows[Tuple[_T]]r0<00>"Optional[_CoreSingleExecuteParams]r<><00>%Optional[CoreExecuteOptionsParameter]r<>z Optional[_T])r/r8r0r<>r<>r<>r<>r)r/r<>r0<00>Optional[_CoreAnyExecuteParams]r<>r<>r<>zScalarResult[_T])r/r8r0r<>r<>r<>r<>zScalarResult[Any])r/zTypedReturnsRows[_T]r0r<>r<>r<>r<>zCursorResult[_T])r/r8r0r<>r<>r<>r<><00>CursorResult[Any])rIzFunctionElement[Any]r8r(r<>r.r<>r<>)rRr?r8r(r<>r.r<>r)r\r;r8r(r<>r.r<>r<>)rdrrer(r<>r,r<>zVTuple[Any, _CoreMultiExecuteParams, _CoreMultiExecuteParams, _CoreSingleExecuteParams])rdr8r8r(r<>r.r<>r<>)r^r:r8r(r<>r.r<>r<>)NN)r/r|r0<00> Optional[_DBAPIAnyExecuteParams]r<>r<>r<>r<>)rIr/r<>zCallable[..., ExecutionContext]r/<00>Union[str, Compiled]r0<00> Optional[_AnyMultiExecuteParams]r<>r,r<>rrtrr<>r<>)
rIr/r<>rr/r<>r0r<>r<>r<>)rIr/r<>rr<>r<>)
r<EFBFBD>rr/r|r0r+r<><00>Optional[ExecutionContext]r<>r<>)r<>rr<>r<>)r<>r<>r/r<>r0zOptional[_AnyExecuteParams]r<><00>Optional[DBAPICursor]r<>r<>r<>r<>r<>r )NNTF)r<>r<>rIr/rU<00>Optional[Engine]r<>r<>r<>r<>r<>r<>r<>r <00>r<>z+Type[Union[SchemaGenerator, SchemaDropper]]r<>rAr<>rr<>r<>)P<>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__<5F>__annotations__<5F>_sqla_logger_namespacerL<00>should_close_with_resultrhrirvrz<00>propertyr~r<>r<>r<>r r<>r<>r<>r<>r<>rdr<>r<>r<>r<>rpr<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>r<>rrr rrrrrr#r&r<>r1r<rArJrWr_rMrGrErwrzrZr<>r<>r<>r<>r<>r<>r<><00> classmethodrYr<>r<>rwrgrHrHWs<><00><00><08>0<15><14>0<>0<>;<3B><1A>>B<01><1A>:<3A>A<>
%<25><1C>6<>6<>'<27>'<27>+<2B>+<2B>4<>4<>
7;<3B>&*<2A>"&<26>!%<25> +/<2F><16>+/<2F>4<>+/<2F>$<24> +/<2F>
 <20> +/<2F> <1F> +/<2F>^#<23><16><03>"<22> 5<> 6<><0E>$<24><0E>$<24><18>(<14><15><0E>7:<3A> <20>*-<2D>#<23>$<24>!<21><1C>*-<2D>AD<41>"'<27><19>4<><19><1B> <19>
(<28> <19> <1C> <19><1D><19><1C><19><17><19>%(<28><19>?<3F><19> <20><19><13><19>
<14><19><0E><19> <0E>><3E><0E>><3E>E<14>N '<27><0E>
<EFBFBD><0E>
<EFBFBD><0E>K<01><0E>K<01>
<0E>H<01><0E>H<01>(<0E>*<2A><0E>*<2A>2*D<01>X<0E>4<><0E>4<>8
<EFBFBD>C<01><0E> $<24><0E> $<24>9&<26>v")<29>H<19>I<0E>VL'<27>\.<2E>:'<27>2)<29>4=<3D>M<01>K<01>M<01>
<EFBFBD> 
<EFBFBD><15> <15>!<21>(<28>$<24>,H<01>$D<01>"<14>E<01>=<3D> $<24>D<01> H<01>D<01>.%<25>`<0E>:><3E><1B>
DH<01> <1B>.<2E><1B>7<><1B>
A<01> <1B>
<16> <1B><0E><1B><0E>:><3E><12>
DH<01> <12><1D><12>7<><12>
A<01> <12>
<0A> <12><0E><12>:><3E><0E>
DH<01> <0E><1D><0E>7<><0E>
A<01> <0E>
<0A> <0E>:<0E>7;<3B><1F>
DH<01> <1F>.<2E><1F>4<><1F>
A<01> <1F>
<1A> <1F><0E><1F><0E>7;<3B> <20>
DH<01>  <20><1D> <20>4<> <20>
A<01>  <20>
<1B>  <20><0E> <20>7;<3B><14>
DH<01> <14><1D><14>4<><14>
A<01> <14>
<1B> <14>2<0E>7;<3B><1F>
DH<01> <1F>'<27><1F>4<><1F>
A<01> <1F>
<1A> <1F><0E><1F><0E>7;<3B> <20>
DH<01>  <20><1D> <20>4<> <20>
A<01>  <20>
<1B>  <20><0E> <20>7;<3B>0<0E>
DH<01> 0<0E><1D>0<0E>4<>0<0E>
A<01> 0<0E>
<1B> 0<0E>d

<EFBFBD>"<22>

<EFBFBD>6<>

<EFBFBD>7<>

<EFBFBD>
<1B>

<EFBFBD>9<13>!<21>9<13>6<>9<13>7<> 9<13>
<0A> 9<13>v3<13> !<21>3<13>6<>3<13>7<> 3<13>
<1B> 3<13>j(G<01><11>(G<01>2<>(G<01>+<2B> (G<01>

<06> (G<01>TG<13><18>G<13>6<>G<13>7<> G<13>
<1B> G<13>Z:O<01> 0<13><1A>0<13>6<>0<13>7<> 0<13>
<1B> 0<13>j8<<3C>CG<43> K<13><16>K<13>5<>K<13>A<01> K<13>
<1B> K<13>Z9<0E><18>9<0E>5<>9<0E>(<28> 9<0E>
5<> 9<0E> +<2B> 9<0E><13>9<0E><12>9<0E>
<1B>9<0E>vL<16><18>L<16>"<22>L<16>(<28> L<16>
5<> L<16>
<1B> L<16>\i<16><18>i<16>"<22>i<16>
<1B> i<16>`/3<> ,<0E><1B>,<0E><17>,<0E>.<2E> ,<0E>
,<2C> ,<0E>
<0E> ,<0E>\ <0E><1D><14><1A>N<EFBFBD>"<22>O'<27> <18>O'<27>!<21>O'<27>0<> O'<27>
&<26> O'<27> ,<2C> O'<27><1A>O'<27>
<12>O'<27>b<11>
$(<28>(,<2C>.2<EFBFBD>!<21>J:<3A> <18>J:<3A><19>J:<3A>!<21> J:<3A>
&<26> J:<3A> (,<2C> J:<3A><1A>J:<3A>
<12>J:<3A><11>J:<3A>X O<01>D<> O<01><1C> O<01><16> O<01>
<0E> OrwrHr1c<01>L<00>eZdZdZdZ dd<03>Zy)r<>z3Implement the :class:`.ExceptionContext` interface.) rdrUrIr<>r/r0<00>original_exceptionr<6E>r<><00>execution_contextr<74>r<>r<>c <01><><00>||_||_||_||_||_| |_||_||_|
|_| |_ | |_
yr<>) rUrIrdr<>r r r/r0r<>r<>r<>) rcr<>r<>rUrIrdr<>r/r0r<>r<>r<>r<>s rgrhzExceptionContextImpl.__init__<5F> sW<00><00><1D><04> <0B><1E><04> <0C>$<24><04><0F>$8<><04>!<21>"+<2B><04><1F>!(<28><04><1E>"<22><04><0E>$<24><04><0F>*<2A><04><1A>-J<><04>*<2A>&<26><04>rwN)r<>r<>r<>zOptional[exc.StatementError]rUrrIr/rd<00>Optional[Connection]r<>r<>r/r<>r0r<>r<>r<>r<>r<>r<>r<>r<>r<>)rrrr<00> __slots__rhr<>rwrgr<>r<><00> s<><00><00>=<3D><06>I<EFBFBD> '<27> <20>'<27>;<3B>'<27>!<21> '<27>
<19> '<27> )<29> '<27>&<26>'<27>!<21>'<27>5<>'<27>,<2C>'<27><1C>'<27>(,<2C>'<27><1A>'rwr<>c<01><><00>eZdZUdZdZdZded<ded<ded<dd <09>Zedd
<EFBFBD><04>Z dd <0B>Z
dd <0C>Z dd <0A>Z edd<0E><04>Z dd<0F>Zdd<10>Zdd<11>Zdd<12>Zdd<13>Zdd<14>Zdd<15>Zy)<1B> Transactiona~Represent a database transaction in progress.
The :class:`.Transaction` object is procured by
calling the :meth:`_engine.Connection.begin` method of
:class:`_engine.Connection`::
from sqlalchemy import create_engine
engine = create_engine("postgresql+psycopg2://scott:tiger@localhost/test")
connection = engine.connect()
trans = connection.begin()
connection.execute(text("insert into x (a, b) values (1, 2)"))
trans.commit()
The object provides :meth:`.rollback` and :meth:`.commit`
methods in order to control transaction boundaries. It
also implements a context manager interface so that
the Python ``with`` statement can be used with the
:meth:`_engine.Connection.begin` method::
with connection.begin():
connection.execute(text("insert into x (a, b) values (1, 2)"))
The Transaction object is **not** threadsafe.
.. seealso::
:meth:`_engine.Connection.begin`
:meth:`_engine.Connection.begin_twophase`
:meth:`_engine.Connection.begin_nested`
.. index::
single: thread safety; Transaction
r<>Fr<46><00>_is_rootr<74>rHrdc<01><00>t<00><00>r<><00><01>NotImplementedError<6F>rcrds rgrhzTransaction.__init__<5F> <00> <00><00>!<21>#<23>#rwc<01><00>t<00><00>)z<>True if this transaction is totally deactivated from the connection
and therefore can no longer affect its state.
rr<>s rg<00>_deactivated_from_connectionz(Transaction._deactivated_from_connection<6F> s <00><00> "<22>#<23>#rwc<01><00>t<00><00>r<>rr<>s rg<00> _do_closezTransaction._do_close
rrwc<01><00>t<00><00>r<>rr<>s rg<00> _do_rollbackzTransaction._do_rollback
rrwc<01><00>t<00><00>r<>rr<>s rg<00>
_do_commitzTransaction._do_commit
rrwc<01>L<00>|jxr|jj Sr<>)r<>rdr<>r<>s rgr<>zTransaction.is_valid
s<00><00><13>~<7E>~<7E>A<>d<EFBFBD>o<EFBFBD>o<EFBFBD>&A<>&A<>"A<>Arwc<01>h<00> |j<00>|jrJ<00>y#|jrJ<00>wxYw)a;Close this :class:`.Transaction`.
If this transaction is the base transaction in a begin/commit
nesting, the transaction will rollback(). Otherwise, the
method returns.
This is used to cancel a Transaction without affecting the scope of
an enclosing transaction.
N)rr<>r<>s rgr<>zTransaction.close
s0<00><00> &<26> <10>N<EFBFBD>N<EFBFBD> <1C><1B>~<7E>~<7E> %<25>%<25>~<7E><>t<EFBFBD>~<7E>~<7E> %<25>%<25>~<7E><><00>!<00>1c<01>h<00> |j<00>|jrJ<00>y#|jrJ<00>wxYw)a<>Roll back this :class:`.Transaction`.
The implementation of this may vary based on the type of transaction in
use:
* For a simple database transaction (e.g. :class:`.RootTransaction`),
it corresponds to a ROLLBACK.
* For a :class:`.NestedTransaction`, it corresponds to a
"ROLLBACK TO SAVEPOINT" operation.
* For a :class:`.TwoPhaseTransaction`, DBAPI-specific methods for two
phase transactions may be used.
N)rr<>r<>s rgr<>zTransaction.rollback
s2<00><00>" &<26> <10> <1D> <1D> <1F><1B>~<7E>~<7E> %<25>%<25>~<7E><>t<EFBFBD>~<7E>~<7E> %<25>%<25>~<7E>r#c<01>h<00> |j<00>|jrJ<00>y#|jrJ<00>wxYw)a<>Commit this :class:`.Transaction`.
The implementation of this may vary based on the type of transaction in
use:
* For a simple database transaction (e.g. :class:`.RootTransaction`),
it corresponds to a COMMIT.
* For a :class:`.NestedTransaction`, it corresponds to a
"RELEASE SAVEPOINT" operation.
* For a :class:`.TwoPhaseTransaction`, DBAPI-specific methods for two
phase transactions may be used.
N)r r<>r<>s rgr<>zTransaction.commit4
s0<00><00>  &<26> <10>O<EFBFBD>O<EFBFBD> <1D><1B>~<7E>~<7E> %<25>%<25>~<7E><>t<EFBFBD>~<7E>~<7E> %<25>%<25>~<7E>r#c<01><00>|jSr<>)rdr<>s rg<00> _get_subjectzTransaction._get_subjectI
s <00><00><13><EFBFBD><EFBFBD>rwc<01><00>|jSr<>)r<>r<>s rg<00>_transaction_is_activez"Transaction._transaction_is_activeL
s <00><00><13>~<7E>~<7E>rwc<01><00>|j Sr<>)rr<>s rg<00>_transaction_is_closedz"Transaction._transaction_is_closedO
s<00><00><17>4<>4<>4<>4rwc<01><00>y<01>NTr<54>r<>s rg<00>_rollback_can_be_calledz#Transaction._rollback_can_be_calledR
s<00><00>
rwN<>rdrHr<>r<>r<>)rrrrrrrrhr rrrr r<>r<>r<>r<>r'r)r+r.r<>rwrgrr<00> s<><00><00>#<08>J<13>I<EFBFBD><1A>H<EFBFBD>d<EFBFBD><1A><13>O<EFBFBD><1A><1A>$<24><0E>$<24><0E>$<24>$<24>$<24>$<24><0E>B<01><0E>B<01>&<26> &<26>,&<26>*<1F><1E>5<>rwrc<01>t<00>eZdZdZdZdZdd<04>Zdd<05>Zedd<06><04>Z dd<07>Z
dd<08>Z dd <09>Z ddd
<EFBFBD>Z dd <0B>Zdd <0C>Zdd <0A>Zy)r<>a<>Represent the "root" transaction on a :class:`_engine.Connection`.
This corresponds to the current "BEGIN/COMMIT/ROLLBACK" that's occurring
for the :class:`_engine.Connection`. The :class:`_engine.RootTransaction`
is created by calling upon the :meth:`_engine.Connection.begin` method, and
remains associated with the :class:`_engine.Connection` throughout its
active span. The current :class:`_engine.RootTransaction` in use is
accessible via the :attr:`_engine.Connection.get_transaction` method of
:class:`_engine.Connection`.
In :term:`2.0 style` use, the :class:`_engine.Connection` also employs
"autobegin" behavior that will create a new
:class:`_engine.RootTransaction` whenever a connection in a
non-transactional state is used to emit commands on the DBAPI connection.
The scope of the :class:`_engine.RootTransaction` in 2.0 style
use can be controlled using the :meth:`_engine.Connection.commit` and
:meth:`_engine.Connection.rollback` methods.
T)rdr<>c<01><><00>|j<00>J<00>|jrtj|<01>||_|j <00>||_d|_yr-)rQrLrr}rd<00>_connection_begin_implr<6C>rs rgrhzRootTransaction.__init__t
sM<00><00><19>&<26>&<26>.<2E>.<2E>.<2E> <15> ,<2C> ,<2C> <20> 1<> 1<>*<2A> =<3D>$<24><04><0F> <0C>#<23>#<23>%<25>"&<26>
<EFBFBD><1F><1D><04>rwc<01><><00>|jr"|jj|usJ<00>d|_y|jj|urtjd<02>yy)NFz0transaction already deassociated from connection)r<>rdrQr!<00>warnr<6E>s rg<00>_deactivate_from_connectionz+RootTransaction._deactivate_from_connection~
sL<00><00> <0F>><3E>><3E><17>?<3F>?<3F>/<2F>/<2F>4<EFBFBD>7<> 7<>7<>"<22>D<EFBFBD>N<EFBFBD> <11>_<EFBFBD>_<EFBFBD> )<29> )<29><14> 5<> <10>I<EFBFBD>I<EFBFBD>H<> I<>6rwc<01>2<00>|jj|uSr<>)rdrQr<>s rgrz,RootTransaction._deactivated_from_connection<6F>
s<00><00><13><EFBFBD><EFBFBD>+<2B>+<2B>4<EFBFBD>7<>7rwc<01>:<00>|jj|<00>yr<>)rdrr<>s rgr2z&RootTransaction._connection_begin_impl<70>
s<00><00> <0C><0F><0F>#<23>#<23>D<EFBFBD>)rwc<01>8<00>|jj<00>yr<>)rdrr<>s rg<00>_connection_rollback_implz)RootTransaction._connection_rollback_impl<70>
s<00><00> <0C><0F><0F>&<26>&<26>(rwc<01>8<00>|jj<00>yr<>)rdr r<>s rg<00>_connection_commit_implz'RootTransaction._connection_commit_impl<70>
s<00><00> <0C><0F><0F>$<24>$<24>&rwc<01>,<00> |jr|j<00>|jjr$|jjj <00>|js|r|j <00>|jj |urd|j_ |jrJ<00>|jj |usJ<00>y#|js|r|j <00>|jj |urd|j_wwxYwr<>)r<>r9rdrS<00>_cancelr5rQ)rc<00>try_deactivates rg<00> _close_implzRootTransaction._close_impl<70>
s<><00><00>
4<><13>~<7E>~<7E><14>.<2E>.<2E>0<><13><EFBFBD><EFBFBD>2<>2<><14><0F><0F>3<>3<>;<3B>;<3B>=<3D><13>~<7E>~<7E><1E><14>0<>0<>2<><13><EFBFBD><EFBFBD>+<2B>+<2B>t<EFBFBD>3<>/3<><04><0F><0F>,<2C><17>><3E>><3E>!<21>!<21><13><EFBFBD><EFBFBD>+<2B>+<2B>4<EFBFBD>7<>7<>7<><37> <14>~<7E>~<7E><1E><14>0<>0<>2<><13><EFBFBD><EFBFBD>+<2B>+<2B>t<EFBFBD>3<>/3<><04><0F><0F>,<2C>4<>s <00>AC <00> A
Dc<01>$<00>|j<00>yr<><00>r?r<>s rgrzRootTransaction._do_close<73>
s<00><00> <0C><18><18>rwc<01>(<00>|jd<01><02>y)NT)r>rAr<>s rgrzRootTransaction._do_rollback<63>
s<00><00> <0C><18><18><04><18>-rwc<01><><00>|jr<>|jj|usJ<00> |j<00>|jjr$|jjj <00>|j <00>d|j_nH|jj|ur|jj<00>ntjd<01><00>|jrJ<00>|jj|usJ<00>y#|jjr$|jjj <00>|j <00>wxYw)N<>This transaction is inactive)
r<EFBFBD>rdrQr;rSr=r5r<>rr<>r<>s rgr zRootTransaction._do_commit<69>
s<><00><00> <0F>><3E>><3E><17>?<3F>?<3F>/<2F>/<2F>4<EFBFBD>7<> 7<>7<> 3<><14>,<2C>,<2C>.<2E>
<18>?<3F>?<3F>6<>6<><18>O<EFBFBD>O<EFBFBD>7<>7<>?<3F>?<3F>A<><14>0<>0<>2<>
,0<>D<EFBFBD>O<EFBFBD>O<EFBFBD> (<28><13><EFBFBD><EFBFBD>+<2B>+<2B>t<EFBFBD>3<><14><0F><0F>4<>4<>6<><19>-<2D>-<2D>.L<>M<>M<><17>><3E>><3E>!<21>!<21><13><EFBFBD><EFBFBD>+<2B>+<2B>4<EFBFBD>7<>7<>7<><37>!<18>?<3F>?<3F>6<>6<><18>O<EFBFBD>O<EFBFBD>7<>7<>?<3F>?<3F>A<><14>0<>0<>2<>s <00>D<00>A ENr/r<>r<>r<>)r>r<>r<>r<>)rrrrrrrhr5r rr2r9r;r?rrr r<>rwrgr<>r<>Z
sU<00><00><08>*<14>H<EFBFBD>+<2B>I<EFBFBD><1E>J<01><0E>8<><0E>8<>*<2A>)<29>'<27>8<> <1B>.<2E>8rwr<>c<01>x<00>eZdZUdZdZded<dd<05>Zddd<06>Zedd<07><04>Z dd<08>Z
dd <09>Z dd
<EFBFBD>Z dd <0B>Z dd <0C>Zy )r<>a<>Represent a 'nested', or SAVEPOINT transaction.
The :class:`.NestedTransaction` object is created by calling the
:meth:`_engine.Connection.begin_nested` method of
:class:`_engine.Connection`.
When using :class:`.NestedTransaction`, the semantics of "begin" /
"commit" / "rollback" are as follows:
* the "begin" operation corresponds to the "BEGIN SAVEPOINT" command, where
the savepoint is given an explicit name that is part of the state
of this object.
* The :meth:`.NestedTransaction.commit` method corresponds to a
"RELEASE SAVEPOINT" operation, using the savepoint identifier associated
with this :class:`.NestedTransaction`.
* The :meth:`.NestedTransaction.rollback` method corresponds to a
"ROLLBACK TO SAVEPOINT" operation, using the savepoint identifier
associated with this :class:`.NestedTransaction`.
The rationale for mimicking the semantics of an outer transaction in
terms of savepoints so that code may deal with a "savepoint" transaction
and an "outer" transaction in an agnostic way.
.. seealso::
:ref:`session_begin_nested` - ORM version of the SAVEPOINT API.
)rdr<><00>
_savepoint<EFBFBD>_previous_nestedr|rFc<01><><00>|j<00>J<00>|jrtj|<01>||_|jj <00>|_d|_|j|_ ||_yr-)
rQrLrr}rdrrFr<>rSrGrs rgrhzNestedTransaction.__init__<5F>
sc<00><00><19>&<26>&<26>2<>2<>2<> <15> ,<2C> ,<2C> <20> 1<> 1<>*<2A> =<3D>$<24><04><0F><1E>/<2F>/<2F>9<>9<>;<3B><04><0F><1D><04><0E> *<2A> ><3E> ><3E><04><1D>)-<2D>
<EFBFBD>&rwc<01><><00>|jj|ur|j|j_y|rtjd<01>yy)Nz7nested transaction already deassociated from connection)rdrSrGr!r4)rcr4s rgr5z-NestedTransaction._deactivate_from_connection<6F>
s=<00><00> <0F>?<3F>?<3F> .<2E> .<2E>$<24> 6<>26<32>2G<32>2G<32>D<EFBFBD>O<EFBFBD>O<EFBFBD> /<2F> <11> <10>I<EFBFBD>I<EFBFBD>I<> <0E>rwc<01>2<00>|jj|uSr<>)rdrSr<>s rgrz.NestedTransaction._deactivated_from_connection<6F>
s<00><00><13><EFBFBD><EFBFBD>2<>2<>$<24>><3E>>rwc<01><><00>d|_|j<00>|jr|jj<00>yy<00>NF)r<>r5rGr=r<>s rgr=zNestedTransaction._cancel s7<00><00><1F><04><0E> <0C>(<28>(<28>*<2A> <0F> <20> <20> <10> !<21> !<21> )<29> )<29> +<2B> !rwc<01><><00> |jr[|jjrE|jjjr%|jj|j<00>d|_|r|j |<02><02> |jrJ<00>|r|jj |usJ<00>yy#d|_|r|j |<02><02>wwxYw)NF)r4)r<>rdrQrrFr5rS)rc<00>deactivate_from_connection<6F>warn_already_deactives rgr?zNestedTransaction._close_impl s<><00><00> M<01><14><0E><0E><18>O<EFBFBD>O<EFBFBD>0<>0<><18>O<EFBFBD>O<EFBFBD>0<>0<>:<3A>:<3A><14><0F><0F>;<3B>;<3B>D<EFBFBD>O<EFBFBD>O<EFBFBD>L<>"<22>D<EFBFBD>N<EFBFBD>)<29><14>0<>0<>6K<36>0<>L<><17>><3E>><3E>!<21>!<21> %<25><17>?<3F>?<3F>6<>6<>d<EFBFBD>B<> B<>B<> &<26><> #<23>D<EFBFBD>N<EFBFBD>)<29><14>0<>0<>6K<36>0<>L<>*<2A>s <00>A'B1<00>1Cc<01>(<00>|jdd<02>y)NTFrAr<>s rgrzNestedTransaction._do_close s<00><00> <0C><18><18><14>u<EFBFBD>%rwc<01>(<00>|jdd<01>yr-rAr<>s rgrzNestedTransaction._do_rollback s<00><00> <0C><18><18><14>t<EFBFBD>$rwc<01>><00>|jr> |jj|j<00>d|_|j <00>y|jj
|ur|jj <00>ytjd<02><00>#d|_wxYw)NFz#This nested transaction is inactive) r<>rdrrFr5rSr<>rr<>r<>s rgr zNestedTransaction._do_commit# s~<00><00> <0F>><3E>><3E> '<27><14><0F><0F>7<>7<><04><0F><0F>H<>
"'<27><04><0E> <11> ,<2C> ,<2C> .<2E><13><EFBFBD><EFBFBD>2<>2<>d<EFBFBD>:<3A><14><0F><0F>4<>4<>6<><19>-<2D>-<2D>9<><12><12><>"'<27><04><0E>s <00>%B<00> BNr/<00>T)r4r<>r<>r<>r<>r<>)rNr<>rOr<>r<>r<>)rrrrrrrhr5r rr=r?rrr r<>rwrgr<>r<><00>
sg<00><00><08>>N<01>I<EFBFBD><13>O<EFBFBD>.<2E><0E><0E>?<3F><0E>?<3F>,<2C>C<01>*.<2E>C<01>GK<47>C<01> <0A>C<01>(&<26>%<25>rwr<>c<01>T<00><00>eZdZUdZdZded<d
<EFBFBD>fd<05> Zd d<06>Zd d<07>Zd d<08>Z d d <09>Z
<EFBFBD>xZ S) r<>aRepresent a two-phase transaction.
A new :class:`.TwoPhaseTransaction` object may be procured
using the :meth:`_engine.Connection.begin_twophase` method.
The interface is the same as that of :class:`.Transaction`
with the addition of the :meth:`prepare` method.
)r<><00> _is_preparedrr<>c<01>@<00><01>d|_||_t<00>|<00> |<01>yrL)rUr<><00>superrh)rcrdr<><00> __class__s <20>rgrhzTwoPhaseTransaction.__init__G s<00><><00>!<21><04><19><16><04><08> <0A><07><18><1A>$rwc<01><><00>|jstjd<01><00>|jj |j
<00>d|_y)zqPrepare this :class:`.TwoPhaseTransaction`.
After a PREPARE, the transaction can be committed.
rDTN)r<>rr<>rdrr<>rUr<>s rg<00>preparezTwoPhaseTransaction.prepareL s;<00><00> <14>~<7E>~<7E><15>)<29>)<29>*H<>I<> I<> <0C><0F><0F>.<2E>.<2E>t<EFBFBD>x<EFBFBD>x<EFBFBD>8<> <20><04>rwc<01>:<00>|jj|<00>yr<>)rdrr<>s rgr2z*TwoPhaseTransaction._connection_begin_implW s<00><00> <0C><0F><0F>,<2C>,<2C>T<EFBFBD>2rwc<01>d<00>|jj|j|j<00>yr<>)rdr#r<>rUr<>s rgr9z-TwoPhaseTransaction._connection_rollback_implZ s <00><00> <0C><0F><0F>/<2F>/<2F><04><08><08>$<24>:K<>:K<>Lrwc<01>d<00>|jj|j|j<00>yr<>)rdr&r<>rUr<>s rgr;z+TwoPhaseTransaction._connection_commit_impl] s <00><00> <0C><0F><0F>-<2D>-<2D>d<EFBFBD>h<EFBFBD>h<EFBFBD><04>8I<38>8I<38>Jrw)rdrHr<>rr<>) rrrrrrrhrZr2r9r;<00> __classcell__)rXs@rgr<>r<>8 s/<00><><00><08>(<28>I<EFBFBD> <0C>H<EFBFBD>%<25>
!<21>3<>M<01>Krwr<>c<01>:<00>eZdZUdZded<ded<eZded<dZd ed
<eZ d ed <d Z
ded<dZ d ed<dZ ded<ded<ded<ded<ded<d ed< d1 d2d<1D>Z d3d<1E>Zed4d<1F><04>Zd5d <20>Zd6d!<21>Zed"d"d"d"d"d#<23> d7d$<24><06>Zed8d%<25><04>Zd8d&<26>Zd9d'<27>Zed:d(<28><04>Zed:d)<29><04>Zej2<00>Zd:d*<2A>Zd;d<d+<2B>Zej< d= d>d,<2C><05>Zej<d?d-<2D><04>Z d@d.<2E>Z!dAd/<2F>Z"dBd0<64>Z#y)Cr<43>a<>
Connects a :class:`~sqlalchemy.pool.Pool` and
:class:`~sqlalchemy.engine.interfaces.Dialect` together to provide a
source of database connectivity and behavior.
An :class:`_engine.Engine` object is instantiated publicly using the
:func:`~sqlalchemy.create_engine` function.
.. seealso::
:doc:`/core/engines`
:ref:`connections_toplevel`
rJrKr<>rmr,rOFr<46>razType[Connection]<5D>_connection_clszsqlalchemy.engine.Enginer|r<00>
_is_futureNr<EFBFBD>r~zType[OptionEngine]<5D> _option_clsr/rIr6r<>r2<00>urlr<6C>c <01><00>||_||_||_|r||_||_||_|dk7r't j||j<00><02>|_ nd|_ tj||<05><03>|r|jdi|<07><01>yy)Nr)<01>
size_alert<EFBFBD><01>echoflagr<67>) r<>rcrI<00> logging_name<6D>echor<6F>r!<00>LRUCache<68>_lru_size_alertrmr <00>instance_logger<65>update_execution_options) rcr<>rIrcrhri<00>query_cache_sizer<65>r<>s rgrhzEngine.__init__<5F> s<><00><00><19><04> <09><16><04><08><1E><04> <0C> <17> ,<2C>D<EFBFBD> <1D><18><04> <09>.<2E><04><1C> <1B>q<EFBFBD> <20>#'<27>=<3D>=<3D> <20>T<EFBFBD>-A<>-A<>$<0E>D<EFBFBD> <20>$(<28>D<EFBFBD> <20> <0B><1B><1B>D<EFBFBD>4<EFBFBD>0<> <1C> )<29>D<EFBFBD> )<29> )<29> ><3E>,=<3D> ><3E> rwc<01><><00>|j<00>r1|jjdt|<01>|j<00>yy)NziCompiled cache size pruning from %d items to %d. Increase cache size to reduce the frequency of pruning.)r^rorpra<00>capacity)rc<00>caches rgrkzEngine._lru_size_alert<72> s9<00><00> <0F> <20> <20> "<22> <10>K<EFBFBD>K<EFBFBD> <1C> <1C>J<01><13>E<EFBFBD>
<EFBFBD><15><0E><0E>  <0E> #rwc<01><00>|S)z<>Returns this :class:`.Engine`.
Used for legacy schemes that accept :class:`.Connection` /
:class:`.Engine` objects within the same variable.
r<>r<>s rgrUz Engine.engine<6E> s <00><00><14> rwc<01>R<00>|jr|jj<00>yy)a<>Clear the compiled cache associated with the dialect.
This applies **only** to the built-in cache that is established
via the :paramref:`_engine.create_engine.query_cache_size` parameter.
It will not impact any dictionary caches that were passed via the
:paramref:`.Connection.execution_options.compiled_cache` parameter.
.. versionadded:: 1.4
N)rm<00>clearr<72>s rg<00>clear_compiled_cachezEngine.clear_compiled_cache<68> s$<00><00> <10> <1F> <1F> <10> <20> <20> &<26> &<26> (<28> rwc <01><><00>|jj||<01>|jj|<01>|_|jj||<01>y)a<>Update the default execution_options dictionary
of this :class:`_engine.Engine`.
The given keys/values in \**opt are added to the
default execution options that will be used for
all connections. The initial contents of this dictionary
can be sent via the ``execution_options`` parameter
to :func:`_sa.create_engine`.
.. seealso::
:meth:`_engine.Connection.execution_options`
:meth:`_engine.Engine.execution_options`
N)rK<00>set_engine_execution_optionsrOr<>rIr<>s rgrmzEngine.update_execution_options<6E> sE<00><00>" <0A> <0A> <0A>2<>2<>4<EFBFBD><13>=<3D>"&<26>"9<>"9<>"?<3F>"?<3F><03>"D<><04><1F> <0C> <0C> <0C>1<>1<>$<24><03><rw.)r<>r<>r<>r<>r|c <01><00>yr<>r<>)rcr<>r<>r<>r<>r|r<>s rgr<>zEngine.execution_options<6E> s<00><00>rwc <01><00>yr<>r<>r<>s rgr<>zEngine.execution_options<6E> s<00><00>=@rwc <01>&<00>|j||<01>S)aReturn a new :class:`_engine.Engine` that will provide
:class:`_engine.Connection` objects with the given execution options.
The returned :class:`_engine.Engine` remains related to the original
:class:`_engine.Engine` in that it shares the same connection pool and
other state:
* The :class:`_pool.Pool` used by the new :class:`_engine.Engine`
is the
same instance. The :meth:`_engine.Engine.dispose`
method will replace
the connection pool instance for the parent engine as well
as this one.
* Event listeners are "cascaded" - meaning, the new
:class:`_engine.Engine`
inherits the events of the parent, and new events can be associated
with the new :class:`_engine.Engine` individually.
* The logging configuration and logging_name is copied from the parent
:class:`_engine.Engine`.
The intent of the :meth:`_engine.Engine.execution_options` method is
to implement schemes where multiple :class:`_engine.Engine`
objects refer to the same connection pool, but are differentiated
by options that affect some execution-level behavior for each
engine. One such example is breaking into separate "reader" and
"writer" :class:`_engine.Engine` instances, where one
:class:`_engine.Engine`
has a lower :term:`isolation level` setting configured or is even
transaction-disabled using "autocommit". An example of this
configuration is at :ref:`dbapi_autocommit_multiple`.
Another example is one that
uses a custom option ``shard_id`` which is consumed by an event
to change the current schema on a database connection::
from sqlalchemy import event
from sqlalchemy.engine import Engine
primary_engine = create_engine("mysql+mysqldb://")
shard1 = primary_engine.execution_options(shard_id="shard1")
shard2 = primary_engine.execution_options(shard_id="shard2")
shards = {"default": "base", "shard_1": "db1", "shard_2": "db2"}
@event.listens_for(Engine, "before_cursor_execute")
def _switch_shard(conn, cursor, stmt, params, context, executemany):
shard_id = conn.get_execution_options().get("shard_id", "default")
current_shard = conn.info.get("current_shard", None)
if current_shard != shard_id:
cursor.execute("use %s" % shards[shard_id])
conn.info["current_shard"] = shard_id
The above recipe illustrates two :class:`_engine.Engine` objects that
will each serve as factories for :class:`_engine.Connection` objects
that have pre-established "shard_id" execution options present. A
:meth:`_events.ConnectionEvents.before_cursor_execute` event handler
then interprets this execution option to emit a MySQL ``use`` statement
to switch databases before a statement execution, while at the same
time keeping track of which database we've established using the
:attr:`_engine.Connection.info` dictionary.
.. seealso::
:meth:`_engine.Connection.execution_options`
- update execution options
on a :class:`_engine.Connection` object.
:meth:`_engine.Engine.update_execution_options`
- update the execution
options for a given :class:`_engine.Engine` in place.
:meth:`_engine.Engine.get_execution_options`
)rbr<>s rgr<>zEngine.execution_options<6E> s<00><00>\<14><1F><1F><04>c<EFBFBD>*<2A>*rwc<01><00>|jS)z<>Get the non-SQL options which will take effect during execution.
.. versionadded: 1.3
.. seealso::
:meth:`_engine.Engine.execution_options`
r<>r<>s rgr<>zEngine.get_execution_options7 r<>rwc<01>.<00>|jjS)zsString name of the :class:`~sqlalchemy.engine.interfaces.Dialect`
in use by this :class:`Engine`.
)rIr<>r<>s rgr<>z Engine.nameB s<00><00><14>|<7C>|<7C> <20> <20> rwc<01>.<00>|jjS)zsDriver name of the :class:`~sqlalchemy.engine.interfaces.Dialect`
in use by this :class:`Engine`.
)rI<00>driverr<72>s rgr~z Engine.driverK s<00><00><14>|<7C>|<7C>"<22>"<22>"rwc<01>"<00>d|j<00>d<02>S)NzEngine(r<>)rcr<>s rg<00>__repr__zEngine.__repr__V s<00><00>#<23>x<EFBFBD>x<EFBFBD>)<29>)rwc<01><><00>|r|jj<00>|jj<00>|_|jj |<00>y)aDispose of the connection pool used by this
:class:`_engine.Engine`.
A new connection pool is created immediately after the old one has been
disposed. The previous connection pool is disposed either actively, by
closing out all currently checked-in connections in that pool, or
passively, by losing references to it but otherwise not closing any
connections. The latter strategy is more appropriate for an initializer
in a forked Python process.
:param close: if left at its default of ``True``, has the
effect of fully closing all **currently checked in**
database connections. Connections that are still checked out
will **not** be closed, however they will no longer be associated
with this :class:`_engine.Engine`,
so when they are closed individually, eventually the
:class:`_pool.Pool` which they are associated with will
be garbage collected and they will be closed out fully, if
not already closed on checkin.
If set to ``False``, the previous connection pool is de-referenced,
and otherwise not touched in any way.
.. versionadded:: 1.4.33 Added the :paramref:`.Engine.dispose.close`
parameter to allow the replacement of a connection pool in a child
process without interfering with the connections used by the parent
process.
.. seealso::
:ref:`engine_disposal`
:ref:`pooling_multiprocessing`
N)r<><00>dispose<73>recreaterK<00>engine_disposed)rcr<>s rgr<>zEngine.disposeY s><00><00>J <11> <10>I<EFBFBD>I<EFBFBD> <1D> <1D> <1F><18>I<EFBFBD>I<EFBFBD>&<26>&<26>(<28><04> <09> <0C> <0A> <0A>%<25>%<25>d<EFBFBD>+rwc#<01>lK<00>|<01>|j<00>5}|<02><02>ddd<00>y|<01><01>y#1swYyxYw<01>wr<>)<01>connect)rcrdr+s rg<00>_optional_conn_ctx_managerz!Engine._optional_conn_ctx_manager<65> s4<00><00><><00> <16> <1D><15><1C><1C><1E>4<EFBFBD><1A>
<EFBFBD> <20><1E><1D> <1C> <20><1E>s<00>4<01>(<03>4<01>1<07>4c#<01><>K<00>|j<00>5}|j<00>5|<01><03>ddd<01>ddd<01>y#1swY<00>xYw#1swYyxYw<01>w)aReturn a context manager delivering a :class:`_engine.Connection`
with a :class:`.Transaction` established.
E.g.::
with engine.begin() as conn:
conn.execute(text("insert into table (x, y, z) values (1, 2, 3)"))
conn.execute(text("my_special_procedure(5)"))
Upon successful operation, the :class:`.Transaction`
is committed. If an error is raised, the :class:`.Transaction`
is rolled back.
.. seealso::
:meth:`_engine.Engine.connect` - procure a
:class:`_engine.Connection` from
an :class:`_engine.Engine`.
:meth:`_engine.Connection.begin` - start a :class:`.Transaction`
for a particular :class:`_engine.Connection`.
N)r<>r<>)rcr+s rgr<>z Engine.begin<69> s:<00><00><><00>2<12>\<5C>\<5C>^<5E>t<EFBFBD><15><1A><1A><1C><1A>
<EFBFBD><1E><1C>^<5E><1D><1C><><1C>^<5E>s.<00>A<01>A<03>:<05>A<03> A<01>A <09>A<03>A<07> Ac <01>v<00>|j<00>5}|j||fi|<03><01>ddd<00>y#1swYyxYwr<>)r<>r<>)rcr<>r<>r<>r+s rgr<>zEngine._run_ddl_visitor<6F> s0<00><00> <12>Z<EFBFBD>Z<EFBFBD>\<5C>T<EFBFBD> !<21>D<EFBFBD> !<21> !<21>/<2F>7<EFBFBD> E<>f<EFBFBD> E<><1A>\<5C>\<5C>s<00>/<03>8c<01>$<00>|j|<00>S)a<Return a new :class:`_engine.Connection` object.
The :class:`_engine.Connection` acts as a Python context manager, so
the typical use of this method looks like::
with engine.connect() as connection:
connection.execute(text("insert into table values ('foo')"))
connection.commit()
Where above, after the block is completed, the connection is "closed"
and its underlying DBAPI resources are returned to the connection pool.
This also has the effect of rolling back any transaction that
was explicitly begun or was begun via autobegin, and will
emit the :meth:`_events.ConnectionEvents.rollback` event if one was
started and is still in progress.
.. seealso::
:meth:`_engine.Engine.begin`
)r`r<>s rgr<>zEngine.connect<63> s<00><00>.<14>#<23>#<23>D<EFBFBD>)<29>)rwc<01>6<00>|jj<00>S)aCReturn a "raw" DBAPI connection from the connection pool.
The returned object is a proxied version of the DBAPI
connection object used by the underlying driver in use.
The object will have all the same behavior as the real DBAPI
connection, except that its ``close()`` method will result in the
connection being returned to the pool, rather than being closed
for real.
This method provides direct DBAPI connection access for
special situations when the API provided by
:class:`_engine.Connection`
is not needed. When a :class:`_engine.Connection` object is already
present, the DBAPI connection is available using
the :attr:`_engine.Connection.connection` accessor.
.. seealso::
:ref:`dbapi_connections`
)r<>r<>r<>s rgrVzEngine.raw_connection<6F> s<00><00>,<14>y<EFBFBD>y<EFBFBD> <20> <20>"<22>"rw)NNi<4E>NF)r<>r6rIr/rcr2rhr<>rizOptional[_EchoFlagType]rnr<>r<>zOptional[Mapping[str, Any]]r<>r<>)rqzutil.LRUCache[Any, Any]r<>r<>)r<>r<>r<><00>r<>rr<>r<>)r<>r<>r<>r|r<>rr<>r<>r|r<>r<>rr<><00> OptionEngine)r<>rr<>r<>r<>)r<>r|rS)r<>r<>r<>r<>r<>)rdrr<><00>Iterator[Connection])r<>r<>rr<>r<>)$rrrrrrErOrarHr`rrar~rhrkr rUrurmr r<>r<>r<>r~r <00> echo_propertyrir<>r<><00>
contextlib<EFBFBD>contextmanagerr<72>r<>r<>r<>rVr<>rwrgr<>r<>a sF<00><00><08> 1<>0<>0<>0<>*?<3F><16><0F>?<3F><1D>K<EFBFBD><14><1D>(2<>O<EFBFBD>%<25>2<>"<<3C><1A>C<EFBFBD><<3C><1C>J<EFBFBD><04><1C>>B<><19>;<3B>B<>#<23>#<23> <14><14>
<0E>J<EFBFBD> <0C>H<EFBFBD><19><19>'+<2B>(,<2C> #<23>9=<3D> %<25>?<3F><12>?<3F><19>?<3F><11> ?<3F>
$<24> ?<3F> &<26> ?<3F><1E>?<3F>7<>?<3F><1E>?<3F>8<0E><0E><14><0E><14> )<29>=<3D>*<0E>7:<3A> <20>*-<2D>*-<2D>AD<41> <1B>4<> <1B><1B> <1B>
(<28> <1B> %(<28> <1B>?<3F> <1B><13> <1B>
<16> <1B><0E> <1B><0E>@<40><0E>@<40>N+<2B>` '<27><0E>!<21><0E>!<21><0E>#<23><0E>#<23> <1D>3<EFBFBD> <1C> <1C> <1E>D<EFBFBD>*<2A>(,<2C>T<10><1E><1E>15<31><1D>.<2E><1D> <1D><1D><1F><1D><10><1E><1E><1B><1F><1B>8F<01>D<>F<01><1C>F<01><16> F<01>
<0E> F<01>*<2A>2#rwr<>c<01><><00>eZdZUdZded<ded<ded<ded <d
ed <d ed <ded< dd<10>Zdd<11>Zejs9e dd<12><04>Z
e
jdd<13><04>Z
e dd<14><04>Z e jdd<15><04>Z yy)<1D>OptionEngineMixinFrJrKr<>rmr/rIr6r<>r2rcr<>r<>zlog.echo_propertyric<01><><00>||_|j|_|j|_|j|_|j|_|j
|_|j |_tj||j<00><01>|jj|j<00>|_ |j|_ |jdi|<02><01>y)Nrfr<>) <0A>_proxiedrcrIrhrirmr<>r rlrKr`rOrm)rc<00>proxiedr<64>s rgrhzOptionEngineMixin.__init__<5F> s<><00><00> <20><04> <0A><1A>;<3B>;<3B><04><08><1E><EFBFBD><EFBFBD><04> <0C>#<23>0<>0<><04><19><1B>L<EFBFBD>L<EFBFBD><04> <09>&<26>6<>6<><04><1C>&<26>6<>6<><04><1C> <0B><1B><1B>D<EFBFBD>4<EFBFBD>9<EFBFBD>9<EFBFBD>5<><1D> <0A> <0A>+<2B>+<2B>G<EFBFBD>,<<3C>,<<3C>=<3D><04> <0A>")<29>"<<3C>"<<3C><04><1F>%<25><04>%<25>%<25>:<3A>(9<>:rwc <01><00>t<00><00>r<>rr<>s rgrmz*OptionEngineMixin.update_execution_options rrwc<01>.<00>|jjSr<><00>r<>r<>r<>s rgr<>zOptionEngineMixin.pool s<00><00><17>=<3D>=<3D>%<25>%<25> %rwc<01>&<00>||j_yr<>r<>)rcr<>s rgr<>zOptionEngineMixin.pool s<00><00>!%<25>D<EFBFBD>M<EFBFBD>M<EFBFBD> rwc<01>j<00>|jjxs|jjdd<02>S)NraF)r<>ra<00>__dict__r}r<>s rgrazOptionEngineMixin._has_events s/<00><00><17>=<3D>=<3D>,<2C>,<2C><0E><04> <0A> <0A>0A<30>0A<30><1D>u<EFBFBD>1<0E> rwc<01>"<00>||jd<y)Nra)r<>)rcr<>s rgrazOptionEngineMixin._has_events! s<00><00>+0<>D<EFBFBD>M<EFBFBD>M<EFBFBD>-<2D> (rwN)r<>r<>r<>r.r<>)r<>r6)r<>r6r<>r<>r<>)r<>r<>r<>r<>) rrr<00>_sa_propagate_class_eventsrrhrm<00>typing<6E> TYPE_CHECKINGr r<><00>setterrar<>rwrgr<>r<><00> s<><00><00>!&<26><1E>0<>0<>0<>0<> <14><14>
<0E>J<EFBFBD> <0C>H<EFBFBD><19><19>
<1B><1B>;<3B><1D>;<3B>2M<32>;<3B>:$<24> <12> <1F> <1F>
<12> &<26>
<12> &<26>
<0E><1B><1B> &<26>
<15> &<26>
<12> <0E>
<12> <0E>
<15> <1B> <1B> 1<>
<1C> 1<>% rwr<>c<01><00>eZdZdd<01>Zy)r<>c <01>0<00>tj|fi|<01><01>yr<>)r<>rmr<>s rgrmz%OptionEngine.update_execution_options' s<00><00><0E>'<27>'<27><04>4<><03>4rwNr<4E>)rrrrmr<>rwrgr<>r<>& s<00><00>5rwr<>)cr<00>
__future__rr<>r<>r<>rrrrrr r
r r r rrrr<00>
interfacesrrrrrrrr!rrrr<>rrr <00>sqlr"r<>r<>r#r$r%r&r'r(r)r*r+r,r-r.r/r0<00>
reflectionr1rcr2<00>eventr3r4r<>r5r6r7r8<00> sql._typingr9<00> sql.compilerr:<00>sql.ddlr;r<r=<00> sql.functionsr><00>
sql.schemar?r@rA<00>sql.selectablerBrC<00>
EMPTY_DICTrErrF<00> InspectablerHr<>rr<>r<>r<><00>
Identifiedr<EFBFBD>r<>r<>rbr<>rwrg<00><module>r<>s<><00><01><04>#<23><11>
<EFBFBD> <0A><16><1B><17><1B><1B><17><1A><1B><1B><1B><18><17><1A><18>"<22>.<2E>#<23>(<28>$<24>(<28>&<26>$<24>%<25>&<26><12><19><12><13><1A>"<22> <09><17><17><1E><1E>-<2D>2<>1<>3<>4<>2<>5<>+<2B>-<2D>7<>#<23>2<>%<25><18>"<22>#<23>'<27><1B>,<2C> <20>'<27>'<27>.<2E>'<27>)<29>/<2F>-<2D>*<2A>'<27>1<> <0A>T<EFBFBD><13><1D><02>)-<2D><1F><1F><15><EFBFBD>8<> $<24><0F><0F>
<EFBFBD> <1D>/<2F>A%O<01>'<27><1A>)?<3F>)?<3F> <0B>)L<>A%O<01>HJ,'<27>+<2B>,'<27>^M<14>&<26>M<14>`i8<>k<EFBFBD>i8<>Xo<12> <0B>o<12>d&K<01>/<2F>&K<01>RA#<23><1A>C<EFBFBD>N<EFBFBD>N<EFBFBD>J<EFBFBD>,B<>,B<>;<3B>,O<>A#<23>H >1<><03><0E><0E>>1<>B5<>$<24>f<EFBFBD>5<>
"<22><06>rw