PK APOCALYPSE V1

APOCALYPSE V1

Current Path : /opt/hc_python/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/
Upload File :
Current File : //opt/hc_python/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/base.cpython-312.pyc

�

���g����UdZddlmZddlZddlZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
dd	lmZdd
lmZddlm
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�D�ZRej�ZTdEeUdF<ej�ZVdGeUdH<GdI�dJee"j�dK�ZXGdL�dMe�ZYGdN�dOe�ZZGdP�dQeZ�Z[GdR�dSeZ�Z\GdT�dUe[�Z]GdV�dWee#j�e"j�dK�Z_GdX�dYe#j��Z`GdZ�d[e`e_�Zaeae__by)\zBDefines :class:`_engine.Connection` and :class:`_engine.Engine`.

�)�annotationsN)�Any)�Callable)�cast)�Iterable)�Iterator)�List)�Mapping)�NoReturn)�Optional)�overload)�Tuple)�Type)�TypeVar)�Union�)�
BindTyping)�ConnectionEventsTarget)�DBAPICursor)�ExceptionContext)�ExecuteStyle)�ExecutionContext)�IsolationLevel)�_distill_params_20)�_distill_raw_params)�TransactionalContext�)�exc)�
inspection)�log)�util)�compiler)�CursorResult)�ScalarResult)�_AnyExecuteParams)�_AnyMultiExecuteParams)�_CoreAnyExecuteParams)�_CoreMultiExecuteParams)�_CoreSingleExecuteParams)�_DBAPIAnyExecuteParams)�_DBAPISingleExecuteParams)�_ExecuteOptions)�CompiledCacheType)�CoreExecuteOptionsParameter)�Dialect)�SchemaTranslateMapType)�	Inspector)�URL)�
dispatcher)�
_EchoFlagType)�_ConnectionFairy)�Pool)�PoolProxiedConnection)�
Executable)�	_InfoType)�Compiled)�ExecutableDDLElement)�
SchemaDropper)�SchemaGenerator)�FunctionElement)�DefaultGenerator)�
HasSchemaAttr)�
SchemaItem)�TypedReturnsRows�_T)�boundr,�_EMPTY_EXECUTION_OPTSzMapping[str, Any]�
NO_OPTIONSc���eZdZUdZded<ded<dZdZded	<d
Zded<d
ed<ded<ded<				da									dbd�ZdZ	ded<dcd�Z
dcd�Zeddd��Z
ded�Zdfd�Zdgd�Zedddd
d
ddddd
d�
																							dhd��Zedid��Zdid �Zdjd!�Zedkd"��Zedkd#��Zedkd$��Zedld%��Zdmd&�Zednd'��Zdod(�Zdld)�Zedpd*��Zdqdrd+�Zdsd,�Zdsd-�Zdtd.�Z dud/�Z!dqdvd0�Z"dsd1�Z#dsd2�Z$dwd3�Z%dxdyd4�Z&dxdyd5�Z'dkd6�Z(dkd7�Z)dkd8�Z*dtd9�Z+dud:�Z,dzd;�Z-d{d<�Z.d|d=�Z/dsd>�Z0dsd?�Z1dqd}d@�Z2d~dA�Z3d~dB�Z4ddC�Z5d�dD�Z6d�dE�Z7d�dF�Z8dsdG�Z9e	dqddH�							d�dI��Z:e	dqddH�							d�dJ��Z:	dqddH�							d�dK�Z:e	dqddH�							d�dL��Z;e	dqddH�							d�dM��Z;	dqddH�							d�dN�Z;e	dqddH�							d�dO��Z<e	dqddH�							d�dP��Z<	dqddH�							d�dQ�Z<								d�dR�Z=								d�dS�Z>								d�dT�Z?								d�dU�Z@								d�dV�ZAeBf							d�dW�ZC		d�							d�dX�ZD																d�dY�ZE										d�dZ�ZF						d�d[�ZG	dq									d�d\�ZHd�d]�ZId
ZJd
ZK	dx													d�d^�ZLeM				d�													d�d_��ZN								d�d`�ZOy)��
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/�dialect�"dispatcher[ConnectionEventsTarget]�dispatchzsqlalchemy.engine.ConnectionNzOptional[TransactionalContext]�_trans_context_managerF�Optional[PoolProxiedConnection]�_dbapi_connectionr,�_execution_options�Optional[RootTransaction]�_transaction�Optional[NestedTransaction]�_nested_transactionc��||_|jx|_}|�	|j�|_n||_dx|_|_	d|_
d|_||_||_
|jj�|_|�*|j j#|j �|_|xs|duxr|j$|_|j&|_|j$s|jj$r|j j)|�yy#|jj
$r}tj|||��d}~wwxYw)zConstruct a new Connection.NrF)�enginerI�raw_connectionrN�loaded_dbapi�ErrorrH�$_handle_dbapi_exception_noconnectionrQrS�_Connection__savepoint_seq�_Connection__in_begin�_Connection__can_reconnect�_allow_autobegin�_should_log_info�_echorK�_join�_has_eventsrO�engine_connect)�selfrU�
connectionra�_allow_revalidater]rI�errs        �G/opt/hc_python/lib64/python3.12/site-packages/sqlalchemy/engine/base.py�__init__zConnection.__init__�s=�����!'���/���w���
�)/�)>�)>�)@��&�&0�D�"�7;�;���D�4� ������0��� 0����[�[�1�1�3��
���!�M�M�/�/����@�D�M�&�
��4��6�F�$6�$6�	
��#)�";�";������t�{�{�6�6��M�M�(�(��.� 7��7�'�'�-�-�
��?�?���&����	
�s�D�E�4E�Er�_message_formatterc���|j}|r||�}tjrdtjz|d<|jj
j|g|��i|��y�Nr�
stacklevel)rir �
STACKLEVEL�STACKLEVEL_OFFSETrU�logger�info�rc�message�arg�kw�fmts     rg�	_log_infozConnection._log_info�sY���%�%����'�l�G��>�>� �3�#8�#8�8�B�|�����������4�#�4��4�c���|j}|r||�}tjrdtjz|d<|jj
j|g|��i|��yrk)rir rmrnrUro�debugrqs     rg�
_log_debugzConnection._log_debug�sY���%�%����'�l�G��>�>� �3�#8�#8�8�B�|�� ������ � ��5�3�5�"�5rwc�>�|jjdd�}|S)N�schema_translate_map)rO�get)rcr|s  rg�_schema_translate_mapz Connection._schema_translate_map�s(��
�#�#�'�'�(>��E�	�$�#rwc��|j}|jjdd�}|r||vr|jr||S|S)ztReturn the schema name for the given schema item taking into
        account current schema translate map.

        r|N)�schemarOr}�_use_schema_map)rc�obj�namer|s    rg�schema_for_objectzConnection.schema_for_object�sP���z�z���#�#�'�'�(>��E�	�

!��,�,��#�#�'��-�-��Krwc��|S�N��rcs rg�	__enter__zConnection.__enter__�s���rwc�$�|j�yr�)�close)rc�type_�value�	tracebacks    rg�__exit__zConnection.__exit__�s���
�
�rw.)
�compiled_cache�
logging_token�isolation_level�
no_parameters�stream_results�max_row_buffer�	yield_per�insertmanyvalues_page_sizer|�preserve_rowcountc
��yr�r�)rcr�r�r�r�r�r�r�r�r|r��opts            rg�execution_optionszConnection.execution_options�s��rwc��yr�r��rcr�s  rgr�zConnection.execution_options�s��;>rwc��|js|jjr|jj||�|jj|�|_|jj||�|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� set_connection_execution_optionsrO�unionrIr�s  rgr�zConnection.execution_optionss`��B���t�{�{�6�6��M�M�:�:�4��E�"&�"9�"9�"?�"?��"D������5�5�d�C�@��rwc��|jS)z�Get the non-SQL options which will take effect during execution.

        .. versionadded:: 1.3

        .. seealso::

            :meth:`_engine.Connection.execution_options`
        �rOr�s rg�get_execution_optionsz Connection.get_execution_options����&�&�&rwc�>�|j}|duxr|jSr�)rN�is_valid�rc�pool_proxied_connections  rg�)_still_open_and_dbapi_connection_is_validz4Connection._still_open_and_dbapi_connection_is_valids)��"&�"8�"8��#�4�/�
1�'�0�0�	
rwc�<�|jduxr
|jS)z)Return True if this connection is closed.N�rNr\r�s rg�closedzConnection.closeds#���%�%��-�J�d�6J�6J�2J�Jrwc�>�|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�r�s  rg�invalidatedzConnection.invalidated!s&��$#'�"8�"8��&�$�.�G�4�3G�3G�Grwc���|j�	|j�S|jS#tjtjf$r�t
$r}|j
|dddd�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�_revalidate_connectionr�PendingRollbackError�ResourceClosedError�
BaseException�_handle_dbapi_exception�rc�es  rgrdzConnection.connection6s|�� �!�!�)�
H��2�2�4�4��)�)�)���,�,�c�.E�.E�F�
�� �
H��,�,�Q��d�D�$�G�G��
H�s�*�,A5�A0�0A5c���|jj}|�J�	|jj|�S#t$r}|j|dddd�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�dbapi_connectionrI�get_isolation_levelr�r�)rcr�r�s   rgr�zConnection.get_isolation_levelPsh��J �?�?�;�;���+�+�+�	D��<�<�3�3�4D�E�E���	D��(�(��D�$��d�C�C��	D�s�7�	A�A�Ac�.�|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�default_isolation_levelr�s rgr�z"Connection.default_isolation_level|s��6�|�|�3�3�3rwc�R�tjd|j�dndzd���)NzfCan't reconnect until invalid %stransaction is rolled back.  Please rollback() fully before proceedingz
savepoint ��8s2b)�code)rr�rSr�s rg�_invalid_transactionzConnection._invalid_transaction�s5���&�&�
?�#�7�7�C�|��
M��	
�	
rwc���|jrS|jrG|j�|j�|jj�|_|jStjd��)N�This Connection is closed)	r\r�rQr�rUrVrNrr�r�s rgr�z!Connection._revalidate_connection�s^�����D�$4�$4�� � �,��)�)�+�%)�[�[�%?�%?�%A�D�"��)�)�)��%�%�&A�B�Brwc�.�|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�s�����#�#�#rwc���|jry|jrtjd��|jr!|j
}|�J�|j
|�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�)r�r�rr�r�rN�
invalidate)rc�	exceptionr�s   rgr�zConnection.invalidate�sa��\�����;�;��)�)�*E�F�F��9�9�&*�&<�&<�#�*�6�6�6�#�.�.�y�9�!%��rwc��|jrtjd��|j}|�tjd��|j�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�InvalidRequestError�detachr�s  rgr�zConnection.detach�sS��4�;�;��)�)�*E�F�F�"&�"8�"8��"�*��)�)�8��
�	 �&�&�(rwc�X�|jr|js|j�yyyr�)r]r[�beginr�s rg�
_autobeginzConnection._autobegins"��� � �����J�J�L�*9� rwc�|�|j�t|�|_|jStjd��)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�RootTransactionrr�r�s rgr�zConnection.beginsB��@���$� /�� 5�D���$�$�$��)�)�#��
rwc�P�|j�|j�t|�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��NestedTransactionr�s rg�begin_nestedzConnection.begin_nestedes&��R���$��O�O�� ��&�&rwc��|j�tjd��|�$|jjj�}t
||�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�
create_xid�TwoPhaseTransaction)rc�xids  rg�begin_twophasezConnection.begin_twophase�sT��(���(��)�)�*��
��;��+�+�%�%�0�0�2�C�"�4��-�-rwc�R�|jr|jj�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�commitr�s rgr�zConnection.commit�s$��,������$�$�&�rwc�R�|jr|jj�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�rollbackr�s rgr�zConnection.rollback�s$��.������&�&�(�rwc�L�|jjj|�Sr�)rUrI�do_recover_twophaser�s rg�recover_twophasezConnection.recover_twophases���{�{�"�"�6�6�t�<�<rwc�T�|jjj|||��y�N)�recover)rUrI�do_rollback_twophase�rcr�r�s   rg�rollback_preparedzConnection.rollback_prepareds!�������0�0��s�G�0�Lrwc�T�|jjj|||��yr�)rUrI�do_commit_twophaser�s   rg�commit_preparedzConnection.commit_prepared	s!�������.�.�t�S�'�.�Jrwc�N�|jduxr|jjS�z,Return True if a transaction is in progress.N)rQ�	is_activer�s rg�in_transactionzConnection.in_transactions$��� � ��,�L��1B�1B�1L�1L�Lrwc�N�|jduxr|jjSr�)rSr�r�s rg�in_nested_transactionz Connection.in_nested_transactions+��
�$�$�D�0�
3��(�(�2�2�	
rwc��|jjdd�}t|dk(xs)|duxr#|jjj
dk(�S)Nr��
AUTOCOMMIT)rOr}�boolrUrI�_on_connect_isolation_level)rc�opt_isos  rg�_is_autocommit_isolationz#Connection._is_autocommit_isolations\���)�)�-�-�.?��F����|�#�
��4�� ��K�K�'�'�C�C�� �	
�	
rwc�L�|j}|�tjd��|S)Nz"connection is not in a transaction)rQrr��rc�transs  rg�_get_required_transactionz$Connection._get_required_transaction"s)���!�!���=��)�)�*N�O�O��rwc�L�|j}|�tjd��|S)Nz)connection is not in a nested transaction)rSrr�r�s  rg� _get_required_nested_transactionz+Connection._get_required_nested_transaction(s/���(�(���=��)�)�;��
��rwc��|jS)zaReturn the current root transaction in progress, if any.

        .. versionadded:: 1.4

        )rQr�s rg�get_transactionzConnection.get_transaction0s��� � � rwc��|jS)zcReturn the current nested transaction in progress, if any.

        .. versionadded:: 1.4

        )rSr�s rg�get_nested_transactionz!Connection.get_nested_transaction9s���'�'�'rwc���|jr3|j�r|jd�n|jd�d|_|js|j
jr|jj|�	|j
jj|j�d|_y#t$r}|j|dddd�Yd}~�+d}~wwxYw#d|_wxYw)Nz?BEGIN (implicit; DBAPI should not BEGIN due to autocommit mode)zBEGIN (implicit)TF)
r_r�rvr[rarUrKr�rI�do_beginrdr�r��rc�transactionr�s   rg�_begin_implzConnection._begin_implAs����:�:��,�,�.����'��
���1�2�������t�{�{�6�6��M�M����%�	$��K�K���(�(����9�$�D�O���	D��(�(��D�$��d�C�C��	D��$�D�O�s*�/B<�<	C$�C�C'�C$�$C'�'	C0c���|js|jjr|jj|�|jrp|j
r3|j
�r|jd�n|jd�	|jjj|j�yy#t$r}|j|dddd�Yd}~yd}~wwxYw)NzVROLLBACK using DBAPI connection.rollback(), DBAPI should ignore due to autocommit mode�ROLLBACK)
rarUrKr�r�r_r�rvrI�do_rollbackrdr�r�r�s  rg�_rollback_implzConnection._rollback_implWs������t�{�{�6�6��M�M�"�"�4�(��9�9��z�z��0�0�2��N�N�E��
�N�N�:�.�
H����#�#�/�/����@�:��!�
H��,�,�Q��d�D�$�G�G��
H�s�
/B;�;	C#�C�C#c��|js|jjr|jj|�|jr3|j�r|j
d�n|j
d�	|jjj|j�y#t$r}|j|dddd�Yd}~yd}~wwxYw)NzRCOMMIT using DBAPI connection.commit(), DBAPI should ignore due to autocommit mode�COMMIT)rarUrKr�r_r�rvrI�	do_commitrdr�r�r�s  rg�_commit_implzConnection._commit_implis������t�{�{�6�6��M�M� � ��&��:�:��,�,�.����A��
���x�(�	D��K�K���)�)�$�/�/�:���	D��(�(��D�$��d�C�C��	D�s�>/B.�.	C�7C�Cc��|js|jjr|jj||�|�$|xjdz
c_d|jz}|jj
j
||�|S)Nrzsa_savepoint_%s)rarUrK�	savepointrZrI�do_savepoint�rcr�s  rg�_savepoint_implzConnection._savepoint_implzsp�����t�{�{�6�6��M�M�#�#�D�$�/��<�� � �A�%� �$�t�';�';�;�D������(�(��t�4��rwc���|js|jjr|jj||d�|jr'|jj
j
||�yyr�)rarUrK�rollback_savepointr�rI�do_rollback_to_savepointr
s  rg�_rollback_to_savepoint_implz&Connection._rollback_to_savepoint_impl�sU�����t�{�{�6�6��M�M�,�,�T�4��>��9�9��K�K���8�8��t�D�:rwc���|js|jjr|jj||d�|jjj||�yr�)rarUrK�release_savepointrI�do_release_savepointr
s  rg�_release_savepoint_implz"Connection._release_savepoint_impl�sG�����t�{�{�6�6��M�M�+�+�D�$��=������0�0��t�<rwc��|jr|jd�|js|jjr&|jj||j�d|_	|jjj||j�d|_y#t$r}|j|dddd�Yd}~�+d}~wwxYw#d|_wxYw)NzBEGIN TWOPHASE (implicit)TF)r_rvrarUrKr�r�r[rI�do_begin_twophaser�r�r�s   rg�_begin_twophase_implzConnection._begin_twophase_impl�s����:�:��N�N�6�7����t�{�{�6�6��M�M�(�(��{���?����	$��K�K���1�1�$����H�$�D�O���	D��(�(��D�$��d�C�C��	D��$�D�O�s*�.0B&�&	C�/C	�C�	C�C�	Cc�\�|js|jjr|jj||�t	|j
t�sJ�	|jjj||�y#t$r}|j|dddd�Yd}~yd}~wwxYwr�)rarUrK�prepare_twophase�
isinstancerQr�rI�do_prepare_twophaser�r�)rcr�r�s   rg�_prepare_twophase_implz!Connection._prepare_twophase_impl�s������t�{�{�6�6��M�M�*�*�4��5��$�+�+�-@�A�A�A�	D��K�K���3�3�D�#�>���	D��(�(��D�$��d�C�C��	D�s�&B�	B+�B&�&B+c�z�|js|jjr|jj|||�|jrEt|jt�sJ�	|jjj|||�yy#t$r}|j|dddd�Yd}~yd}~wwxYwr�)rarUrK�rollback_twophaser�rrQr�rIr�r�r��rcr��is_preparedr�s    rg�_rollback_twophase_implz"Connection._rollback_twophase_impl�s������t�{�{�6�6��M�M�+�+�D�#�{�C��9�9��d�/�/�1D�E�E�E�
H����#�#�8�8��#�{��:��!�
H��,�,�Q��d�D�$�G�G��
H�s�)'B�	B:�B5�5B:c�`�|js|jjr|jj|||�t	|j
t�sJ�	|jjj|||�y#t$r}|j|dddd�Yd}~yd}~wwxYwr�)rarUrK�commit_twophaserrQr�rIr�r�r�r!s    rg�_commit_twophase_implz Connection._commit_twophase_impl�s������t�{�{�6�6��M�M�)�)�$��[�A��$�+�+�-@�A�A�A�	D��K�K���2�2�4��k�J���	D��(�(��D�$��d�C�C��	D�s�'B�	B-�B(�(B-c��|jr|jj�d}nd}|j�B|j}|rtd|�j	d��n|j�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)�transaction_reset)rQr�rNr�_close_specialr\)rc�
skip_reset�conns   rgr�zConnection.close�s���.������#�#�%��J��J��!�!�-��)�)�D���'��.�=�=�&*�>���
�
��&*�D�"�$��rw�r�c��yr�r��rc�	statement�
parametersr�s    rg�scalarzConnection.scalar�s��rwc��yr�r�r.s    rgr1zConnection.scalar�s��rwc��t|�}	|j}||||xst�S#t$r}t	j
|�|�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�_execute_on_scalarrF�AttributeErrorr�ObjectNotExecutableError�rcr/r0r��distilled_parameters�methrfs       rgr1zConnection.scalarsc��" 2�*�=��		��/�/�D���$�!�/�Z��
���	C��.�.�y�9�s�B��	C���+�	A�A
�
Ac��yr�r�r.s    rg�scalarszConnection.scalars���rwc��yr�r�r.s    rgr<zConnection.scalars(��� rwc�F�|j|||��j�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,)�executer<r.s    rgr<zConnection.scalars1s)��*�|�|��z�5F��
�
�'�)�	rwc��yr�r�r.s    rgrAzConnection.executeJr=rwc��yr�r�r.s    rgrAzConnection.executeSr?rwc��t|�}	|j}||||xst�S#t$r}t	j
|�|�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�_execute_on_connectionrFr5rr6r7s       rgrAzConnection.execute\sd��L 2�*�=��		��3�3�D���$�!�/�Z��
���	C��.�.�y�9�s�B��	C�r:c�D�|j|j�||�S)z%Execute a sql.FunctionElement object.)�_execute_clauseelement�select)rc�funcr8r�s    rg�_execute_functionzConnection._execute_function�s&���*�*��K�K�M�/�1B�
�	
rwc��|jj|�}|js|jjr|j	|||�\}}}}ndx}}	|j
}|�|j
�}|j}|jj||||�}jd|d�}
|js|jjr |j j#||||||
�|
S#tjtjf$r�t$r}	|j|	dddd�Yd}	~	��d}	~	wwxYw)z&Execute a schema.ColumnDefault object.N)rO�
merge_withrarU�_invoke_before_exec_eventrNr�rI�execution_ctx_cls�
_init_defaultrr�r�r�r��
_exec_defaultrK�
after_execute)rc�defaultr8r��event_multiparams�event_paramsr+rI�ctxr��rets           rg�_execute_defaultzConnection._execute_default�sX��!�3�3�>�>��
�����t�{�{�6�6��.�.��-�/@��
��$�!��
04�3���	D��)�)�D��|��2�2�4���l�l�G��+�+�9�9���t�%6��C�����g�t�4�����t�{�{�6�6��M�M�'�'���!��!��

��
��#�(�(�#�*A�*A�B�	���	D��(�(��D�$��d�C�C��	D�s�AC;�;,E�'E�Ec�
�|jj|j|�}|js|jjr|j	|||�\}}}}ndx}}|jdd�}|j}|j||��}	|j||jj|	d||	�}
|js|jjr |jj||||||
�|
S)zExecute a schema.DDL object.Nr|)rIr|)
rOrLrarUrMr}rI�compile�_execute_contextrN�	_init_ddlrKrQ)rc�ddlr8r��	exec_optsrSrTr|rI�compiledrVs           rg�_execute_ddlzConnection._execute_ddl�s���*�*�5�5��#�#�%6�
�	����t�{�{�6�6��.�.��)�9��
��$�!��
04�3���(�}�}�-C�T�J���,�,���;�;��2F��
���#�#���%�%�/�/�����

�����t�{�{�6�6��M�M�'�'���!����

��
rwc���t|�dk(rg|d}}n|i}}|jjD]}||||||�\}}}�|r"t|�}|rt	j
d��|r|g}ng}||||fS)NrrzLEvent handler can't return non-empty multiparams and params at the same time)�lenrK�before_execute�listrr�)rc�elem�distilled_paramsr�rSrT�fns       rgrMz$Connection._invoke_before_exec_event
s����� �A�%�.0�2B�1�2E�|��.>��|���-�-�.�.�B�46���!��!�5�1�D�#�\�/��#�$5�6����-�-�2���� ,�~��!���%�'8�,�F�Frwc��|jj|j|�}|jxs|jj}|r|j	|||�\}}}}|rt|d�}t
|�dkD}ng}d}|j}	|jdd�}
|jd|jj�}|j|	||||
|jjtjz��\}}
}|j|	|	jj |||||||
|��
}|r |j"j%||||�|S)	z#Execute a sql.ClauseElement object.rrFr|Nr�)rIr��column_keys�for_executemanyr|�linting)�	cache_hit)rOrLrarUrM�sortedrarIr}�_compiled_cache�_compile_w_cache�compiler_lintingr"�WARN_LINTINGrZrN�_init_compiledrKrQ)rcrdr8r��
has_eventsrSrT�keysrirIr|r��compiled_sql�extracted_paramsrkrVs                rgrGz!Connection._execute_clauseelement4s���!�3�3�>�>��#�#�%6�
���%�%�@����)@�)@�
���.�.��*�,=��
��$�!��
 ��.�q�1�2�D�!�"6�7�!�;�O��D�#�O��,�,��0�4�4�"�D� 
��7H�6K�6K��d�k�k�9�9�7
��59�4I�4I��)��+�!5��L�L�1�1�H�4I�4I�I�
5J�5
�1��&�	��#�#���%�%�4�4�� ��� ����$�
����M�M�'�'���!��!��

��
rwc��|jj|j|�}|js|jjr|j|||�\}}}}|j}|j||jj|||||dd�	}|js|jjr |jj||||�|S)ziExecute a sql.Compiled object.

        TODO: why do we have this?   likely deprecate or remove

        N)r�rLrOrarUrMrIrZrNrqrKrQ)rcr^r8r�rSrTrIrVs        rg�_execute_compiledzConnection._execute_compiled}s���%�6�6�A�A��#�#�%6�
�����t�{�{�6�6��.�.��.�0A��
��$�!��
�,�,���#�#���%�%�4�4�� ��� ���

�����t�{�{�6�6��M�M�'�'���!��!��

��
rwc	��t|�}|jj|�}|j}|j	||j
j|d|||�}|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�_init_statement)rcr/r0r�r8rIrVs       rg�exec_driver_sqlzConnection.exec_driver_sql�sm��t 3�:�>�� �3�3�>�>��
���,�,���#�#���%�%�5�5����� �
���
rwc�*�|r(|jdd�}|r|jd|d��}	|j}	|	�|j�}	||||	|g|��i|��}
|jr|jjr"|jr'|jjs|j�n!|jrtj |�|j�|j#�
j%�|
j&t(j*ur|j-||
�S|j/||
||�S#tj
tjf$r�t$r)}|j|t|�|dd�Yd}~��4d}~wwxYw)zdCreate an :class:`.ExecutionContext` and execute, returning
        a :class:`_engine.CursorResult`.r�NT)r�r�)r}r�rNr�rr�r�r�r��strrQr�rSr�rLr�_trans_ctx_checkr��pre_exec�
execute_styler�INSERTMANYVALUES�_exec_insertmany_context�_exec_single_context)rcrI�constructorr/r0r��argsrt�ypr+�contextr�s            rgrZzConnection._execute_context�s����"�&�&�{�D�9�B��$5�$;�$;�'+�r�B�%�!�
	��)�)�D��|��2�2�4��!���t�%6��9=��AC��G�
����%�%�/�/��(�(��0�0�:�:�
�%�%�'�
�
(�
(� �1�1�$�7����$��O�O������� � �L�$A�$A�A��0�0��'�B�B��,�,���)�Z��
��9�(�(�#�*A�*A�B�	���	��(�(��3�y�>�:�t�T�
�
��	�s�-D=�=,F�)F
�
Fc	�p�|jtjur0|j�}|r	|j	|j
||�|j
|j|j}}}|js|d}	n|}	|js|jjr5|jjD]}
|
||||	||j�\}}	�|j r}|j#|�|j%�}|jj&s4|j#d|t)j*|	d|j���n|j#d|�d}	|j,t.j0urxt3d|	�}	|j4jr4|j4jj6D]}
|
|||	|�s�d	}n|�s|j4j7|||	|�n�|	su|j8ri|j4jr3|j4jj:D]}
|
|||�s�d	}n|s�|j4j;|||�nvt3d
|	�}	|j4jr4|j4jj<D]}
|
|||	|�s�d	}n|s|j4j=|||	|�|js|jjr*|jj?||||	||j�|jA�|jC�}
|
S#t$r)}|j|t|�|d|�Yd}~��7d}~wwxYw#t$r }|j|||	||�Yd}~
Sd}~wwxYw)zzcontinue the _execute_context() method for a single DBAPI
        cursor.execute() or cursor.executemany() call.

        Nr�[%s] %r�
��batches�ismulti�8[%s] [SQL parameters hidden due to hide_parameters=True]Fr(Tr))"�bind_typingr�
SETINPUTSIZES�_prepare_set_input_sizes�do_set_input_sizes�cursorr�r�r|r/r0�executemanyrarUrK�before_cursor_executer_rv�_get_cache_stats�hide_parameters�sql_util�_repr_paramsrr�EXECUTEMANYrrI�do_executemanyr��do_execute_no_params�
do_execute�after_cursor_execute�	post_exec�_setup_result_proxy)rcrIr�r/r0�generic_setinputsizesr�r��
str_statement�effective_parametersrf�stats�evt_handled�results              rgr�zConnection._exec_single_context7s������*�":�":�:�$+�$D�$D�$F�!�$���.�.����(=�w��
�N�N������� *�
���"�"�#-�a�=� �#-� ����t�{�{�6�6��m�m�9�9��68���!�(���'�'�
7�3�
�3�:��:�:��N�N�=�)��,�,�.�E��;�;�.�.�������)�)�,� "� '� 3� 3������N���
"��D	��$�$��(@�(@�@�'+�-�/C�(�$��<�<�+�+�"�l�l�3�3�B�B���"�)�0�#�	�+/�K�!�C�#��L�L�/�/��%�,��	�*�g�.C�.C��<�<�+�+�"�l�l�3�3�H�H���f�m�W�=�*.�K�!�I�#��L�L�5�5��
�w��(,�.�0D�(�$��<�<�+�+�"�l�l�3�3�>�>���"�)�0�#�	�+/�K�!�?�#��L�L�+�+��
�/C�W�����4�;�;�#:�#:��
�
�2�2���!�(���'�'�
�
�����0�0�2�F��
��s%���0�0��3�y�>�:�t�W������h�	��(�(��=�"6���
�
��
��	�sE�M�(A,N�A8N�A5N�BN�	N	� N�N	�	N5�N0�0N5c
�j�|jtjur|j�}nd}|j|j
|j}}}|}|jxs|jj}|jjr!|jjj}	nd}	|jr|j�dz}
|jjdd�}d}|j!||||||�D�]�}
|
j"r(	|j%|j|
j"|�|
j.}|
j0}|r+|jj2D]}||||||d�\}}�|jr�|j5t+j,|��d	|
j6�d
|
j8�d|
j:rdnd
�|
j<rdnd�d�}|
j6dk(r
|z
}
nd|��}
|jj>s*|j5d|
t+j@|dd���n|j5d|
�	|	D]}|||||�s�n|j||||�|r*|jjC||||||jD�|s���||
jFz
}���	|jI�|r||_%|jM�}|S#t&$rI}|j)|t+j,|
j.�|
j0d|d��Yd}~��d}~wwxYw#t&$r4}|j)|t+j,|�|||d��Yd}~��d}~wwxYw#t&$r }|j)|||||�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�z (insertmanyvalues)r�FrT)�is_sub_exec� �/z (�ordered�	unorderedz; batch not supportedr��)r�insertmanyvaluesr�r�r�r�)'r�rr�r�r�r/r0rarUrIrKr�r_r�r�r}�!_deliver_insertmanyvalues_batches�processed_setinputsizesr�r�r�r��_long_statement�replaced_statement�replaced_parametersr�rv�batchnum�
total_batches�rows_sorted�
is_downgradedr�r�r�r��current_batch_sizer��	_rowcountr�)rcrIr�r�r�r�r0r��
engine_events�do_execute_dispatchr�r��rowcount�	imv_batchr��sub_stmt�
sub_paramsrf�	imv_statsr�s                    rgr�z#Connection._exec_insertmany_context�s�����*�":�":�:�$+�$D�$D�$F�!�$(�!�
�N�N������� *�
�� *���(�(�C�D�K�K�,C�,C�
��<�<�#�#����%�%�0�0�
 �#%���:�:��,�,�.�1F�F�E�#�5�5�9�9���
���� �B�B���� �!��

�I��0�0���.�.����!�9�9���!�3�3�H�"�6�6�J���-�-�=�=�B�+-��� �"���
,�(�H�j�>��z�z����x�7�7��A�B� !�)�"4�"4�!5�Q�%�3�3�7�� �,�,��2=��
!�.�.�,����	�	��%�%��*��Y�&�E�.�y�k�:�E��{�{�2�2��N�N�!�� �-�-�&�$&�$)����N�N�0���
�-�B��� �"��	��.��&�&�� �"��	�"��
�
�2�2���!�(���'�'�
�!��I�8�8�8��c
�f	����� �$,��!��0�0�2�F��
��c%���0�0�� �0�0��1M�1M�N�!�5�5���$(�
1������Z!�
��,�,���,�,�X�6���� $�
-����
��>�	��(�(��=�"6���
�
��
��	�sN�'K4�M	�/M	�	)N	�4	M�=>M�M�		N�*N�N�		N2�N-�-N2c	��|js|jjr+|jjD]}||||||d�\}}�|jr#|j|�|jd|�	|jjsdn|jjjD]}|||||�s�n|jj||||�|js|jjr!|jj|||||d�yy#t$r}|j|||||�Yd}~�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�N)rarUrKr�r_rvrIr�r�r�r�)rcr�r/r0r�rfr�s       rg�_cursor_executezConnection._cursor_executeps?��"���t�{�{�6�6��m�m�9�9��(*��&�)�Z��%�)�%�	�:�:�
�:�:��N�N�9�%��N�N�>�:�6�
	��|�|�/�/���\�\�*�*�5�5�6��
�f�i��W�=��6����'�'��	�:�w�O����t�{�{�6�6��M�M�.�.��f�i��W�e�
� 7���	��(�(��9�j�&�'�
�
��	�s�>AD*�!D*�*	E�3E
�
Ec��	|j�y#t$r4|jjjjdd��YywxYw)z\Close the given cursor, catching exceptions
        and turning into log warnings.

        zError closing cursorT)�exc_infoN)r��	ExceptionrU�poolro�error)rcr�s  rg�_safe_close_cursorzConnection._safe_close_cursor�sG��
	��L�L�N���	��K�K���#�#�)�)�&��
*�
�	�s��:A�Ac�Z�tj�}tj|�}|js�t||jjj�xrD|jxr5|jj||js|jnd|�xs|xr
|j|_|}	|�|xr|jnd}
|jrutj j#||||jjj|j$j&|j|
��j)|d�|�d|_	t||jjj�xs|duxr	|duxr|}|r|tj j#||t+t,|�|jjj|j$j&|j|j|
��}nd}d}
|jj.r�|j0j3dd�s�t5|||j$|j||||||j|	d�}|jj6j8D]}	||�}|�	|x|_}
�|j|jk7r$|j|_|r|j|_|j>}	|r|r|jA|�|js3|r|jC|�|jE�s|jG�|
r|
j)|d�|�|r|�J�|j)|d�|�|d�J�|dj)|d��#t,$r
}|}
Yd}~��d}~wwxYw#|`|jrY|`|jsJ|j}|�J�|	r&|j$jHjK||�|jM|�wwwxYw)NF)r�rIr�rT)r��connection_invalidatedrIr��skip_user_error_eventsr)'�sysr�r!�is_exit_exception�_is_disconnectrrIrWrXr��
is_disconnectr�rNr��_reentrant_errorr�
DBAPIError�instancerUr��with_tracebackrr�rarOr}�ExceptionContextImplrK�handle_error�chained_exceptionr��invalidate_pool_on_disconnect�handle_dbapi_exceptionr�r�rr��_invalidater�)rcr�r/r0r�r�r�r�r�r�r��should_wrap�sqlalchemy_exception�newraiserUrf�per_fn�_raised�dbapi_conn_wrappers                   rgr�z"Connection._handle_dbapi_exception�s!���<�<�>�� �2�2�1�5���"�"��1�d�l�l�7�7�=�=�>�����O���L�L�.�.��26�2B�2B�D�*�*����#9�$�7�D�K�K��
��->�(=�%��"��O�3�� 3� 3��	�
� � ��.�.�)�)�������)�)�/�/� $��� ;� ;�����*���n�X�a�[�)�q�
1�!%���e	'�%�Q����(A�(A�(G�(G�H����%�*��t�O�*�)�)�
��'*�~�~�'>�'>�����A�&��L�L�-�-�3�3�$(�K�K�$?�$?�+/�+>�+>� �L�L�#�(?�	(�$�(,�$��H����(�(�$�2I�2I�2M�2M�(�%�3�+��(��K�K��L�L�������'�'�1��
���,�,�/�/�<�<�B�	�"$�C���!�-�?E�E�C�1�H��
=��&�&�#�*;�*;�;�*-�*;�*;�D�'�+��-�-�-�C��5�5�.��w��.�.�q�1��&�&���+�+�F�3��*�*�,��'�'�)���-�-�h�q�k�:��A��+�7�7�7�*�9�9�(�1�+�F�A�M���{�.�.�.��q�k�0�0��!��=�=��S%��#*������V�%��"�"��'��'�'�)-�)?�)?�&�-�9�9�9�4����(�(�4�4�5G��K��O�O�A�&�(�#�s9�EO�&N(�9C/O�(	N>�1N9�3O�9N>�>O�A)P*c�N�tj�}|�5t||jj�xr|j|dd�}t||jj�}|rWtjjddtt|�|jj|�|jnd||��}	nd}	d}
|jrit||	||ddddd|||�}|jjD]}	||�}
|
�	|
x|_}
�|	r"||j
k7r|j
x|	_}|
r|
j%|d�|�|r|	�J�|	j%|d�|�|d�J�|dj%|d��#t$r
}|}
Yd}~��d}~wwxYw)NF)r�r�rIrr)r�r�rrWrXr�rr�r�rr�r�rar�rKr�r�r�r�)�clsr�rIrUr�r��is_pre_pingr�r�r�r�rUrfr�r�s               rgrYz/Connection._handle_dbapi_exception_noconnection?	s����<�<�>��� �&��7�'�'�-�-��7��'�'��4��6�
�!��G�$8�$8�$>�$>�?���#&�>�>�#:�#:����Y��"��$�$�*�*�.4�.@�F�*�*�e�'4��$;�
$� �$(� ������&��$���������-��
�C��&�&�3�3��	� ��W�F��)�;A�A��-���
4�$�
��9J�9J�(J��%�%��$�;�m���)�)�(�1�+�6�A�=�
�'�3�3�3�&�5�5�h�q�k�B��I��A�;�*�*�*��1�+�,�,�X�a�[�9�9��#!��&�H����s�F�	F$�F�F$c�J�||j|fi|��j|�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�traverse_single)rc�visitorcallable�element�kwargss    rg�_run_ddl_visitorzConnection._run_ddl_visitor�	s"��	����d�5�f�5�E�E�g�Nrw)NNTT)
rU�EnginerdrMra�Optional[bool]rer�r]r�)rrr|rsrrtr�return�None)r�� Optional[SchemaTranslateMapType])r�r@r��
Optional[str]�r�rH)r�rr�rr�rr�r�)r��Optional[CompiledCacheType]r�r|r�rr�r�r�r�r��intr�r�r�r�r|r�r�r�r�rr�rH)r�rr�rH�r�r,�r�r��r�r7)r�r)r�zOptional[IsolationLevel])r�r)r�r9r�)r�zOptional[BaseException]r�r��r�r�)r�r�)r�r�)r�z
Optional[Any]r�r�)r�z	List[Any]�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/�TypedReturnsRows[Tuple[_T]]r0�"Optional[_CoreSingleExecuteParams]r��%Optional[CoreExecuteOptionsParameter]r�zOptional[_T])r/r8r0r�r�r�r�r)r/r�r0�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��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� Optional[_DBAPIAnyExecuteParams]r�r�r�r�)rIr/r�zCallable[..., ExecutionContext]r/�Union[str, Compiled]r0� Optional[_AnyMultiExecuteParams]r�r,r�rrtrr�r�)
rIr/r�rr/r�r0r�r�r�)rIr/r�rr�r�)
r�rr/r|r0r+r��Optional[ExecutionContext]r�r�)r�rr�r�)r�r�r/r�r0zOptional[_AnyExecuteParams]r��Optional[DBAPICursor]r�r�r�r�r�r)NNTF)r�r�rIr/rU�Optional[Engine]r�r�r�r�r�r�r�r�r�z+Type[Union[SchemaGenerator, SchemaDropper]]r�rAr�rr�r�)P�__name__�
__module__�__qualname__�__doc__�__annotations__�_sqla_logger_namespacerL�should_close_with_resultrhrirvrz�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��classmethodrYr�r�rwrgrHrHWs����0��0�0�;��>B��:�A�
 %��6�6�'�'�+�+�4�4�
7;�&*�"&�!%�
+/��+/�4�+/�$�	+/�
 �+/��
+/�^#���"�	5�	6��$��$��(���7:� �*-�#�$�!��*-�AD�"'��4���	�
(���
�������%(��?�� ����
���� �>��>�E�N	'��
��
��K��K�
�H��H�(�*��*�2*D�X�4��4�8
�C��$��$�9&�v")�H�I�VL'�\.�:'�2)�4=�M�K�M�
�	
���!�(�$�,H�$D�"�E�=�$�D�H�D�.%�`�:>��
DH��.��7��
A��
�
����:>��
DH����7��
A��

�
���:>��
DH����7��
A��

�
�:�7;��
DH��.��4��
A��
�
����7;� �
DH� �� �4� �
A� �
�
 �� �7;��
DH����4��
A��
�
�2�7;��
DH��'��4��
A��
�
����7;� �
DH� �� �4� �
A� �
�
 �� �7;�0�
DH�0��0�4�0�
A�0�
�
0�d

�"�

�6�

�7�	

�

�

�9�!�9�6�9�7�	9�


�9�v3�
!�3�6�3�7�	3�

�3�j(G��(G�2�(G�+�	(G�

�(G�TG��G�6�G�7�	G�

�G�Z:O�	0��0�6�0�7�	0�

�0�j8<�CG�	K��K�5�K�A�	K�

�K�Z9��9�5�9�(�	9�
5�9�+�
9��9��9�
�9�vL��L�"�L�(�	L�
5�L�
�
L�\i��i�"�i�
�	i�`/3�,��,��,�.�	,�
,�,�
�
,�\����N�"�O'��O'�!�O'�0�	O'�
&�O'�,�
O'��O'�
�O'�b�
$(�(,�.2�!�J:��J:��J:�!�	J:�
&�J:�(,�
J:��J:�
�J:��J:�XO�D�O��O��	O�

�OrwrHr1c�L�eZdZdZdZ																								dd�Zy)r�z3Implement the :class:`.ExceptionContext` interface.)
rdrUrIr�r/r0�original_exceptionr�r��execution_contextr�r�r�c
��||_||_||_||_||_|	|_||_||_|
|_||_	||_
yr�)rUrIrdr�rr
r/r0r�r�r�)
rcr�r�rUrIrdr�r/r0r�r�r�r�s
             rgrhzExceptionContextImpl.__init__�	sW��������$���$8��!�"+���!(���"���$���*���-J��*�&��rwN)r�r�r�zOptional[exc.StatementError]rUrrIr/rd�Optional[Connection]r�r�r/r�r0r�r�r�r�r�r�r�r�r�)rrrr�	__slots__rhr�rwrgr�r��	s���=��I� '� �'�;�'�!�	'�
�'�)�
'�&�'�!�'�5�'�,�'��'�(,�'��'rwr�c��eZdZUdZdZdZded<ded<ded<dd	�Zedd
��Z	dd�Z
dd�Zdd
�Zedd��Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zy)�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��_is_rootr�rHrdc��t��r���NotImplementedError�rcrds  rgrhzTransaction.__init__�	���!�#�#rwc��t��)z�True if this transaction is totally deactivated from the connection
        and therefore can no longer affect its state.

        rr�s rg�_deactivated_from_connectionz(Transaction._deactivated_from_connection�	s
��"�#�#rwc��t��r�rr�s rg�	_do_closezTransaction._do_close
rrwc��t��r�rr�s rg�_do_rollbackzTransaction._do_rollback
rrwc��t��r�rr�s rg�
_do_commitzTransaction._do_commit
rrwc�L�|jxr|jjSr�)r�rdr�r�s rgr�zTransaction.is_valid

s���~�~�A�d�o�o�&A�&A�"A�Arwc�h�	|j�|jrJ�y#|jrJ�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��	&��N�N���~�~�%�%�~��t�~�~�%�%�~���!�1c�h�	|j�|jrJ�y#|jrJ�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��"	&������~�~�%�%�~��t�~�~�%�%�~�r#c�h�	|j�|jrJ�y#|jrJ�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�� 	&��O�O���~�~�%�%�~��t�~�~�%�%�~�r#c��|jSr�)rdr�s rg�_get_subjectzTransaction._get_subjectI
s�����rwc��|jSr�)r�r�s rg�_transaction_is_activez"Transaction._transaction_is_activeL
s���~�~�rwc��|jSr�)rr�s rg�_transaction_is_closedz"Transaction._transaction_is_closedO
s���4�4�4�4rwc��y�NTr�r�s rg�_rollback_can_be_calledz#Transaction._rollback_can_be_calledR
s��
rwN�rdrHr�r�r�)rrrrrrrrhr	rrrr r�r�r�r�r'r)r+r.r�rwrgrr�	s���#�J�I��H�d���O���$��$��$�$�$�$��B��B�&� &�,&�*��5�rwrc�t�eZdZdZdZdZdd�Zdd�Zedd��Z	dd�Z
dd�Zdd	�Zddd
�Z
dd�Zdd�Zdd
�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��|j�J�|jrtj|�||_|j�||_d|_yr-)rQrLrr}rd�_connection_begin_implr�rs  rgrhzRootTransaction.__init__t
sM���&�&�.�.�.��,�,� �1�1�*�=�$����#�#�%�"&�
����rwc��|jr"|jj|usJ�d|_y|jj|urtjd�yy)NFz0transaction already deassociated from connection)r�rdrQr!�warnr�s rg�_deactivate_from_connectionz+RootTransaction._deactivate_from_connection~
sL���>�>��?�?�/�/�4�7�7�7�"�D�N�
�_�_�
)�
)��
5��I�I�H�I�6rwc�2�|jj|uSr�)rdrQr�s rgrz,RootTransaction._deactivated_from_connection�
s�����+�+�4�7�7rwc�:�|jj|�yr�)rdrr�s rgr2z&RootTransaction._connection_begin_impl�
s�����#�#�D�)rwc�8�|jj�yr�)rdrr�s rg�_connection_rollback_implz)RootTransaction._connection_rollback_impl�
s�����&�&�(rwc�8�|jj�yr�)rdr	r�s rg�_connection_commit_implz'RootTransaction._connection_commit_impl�
s�����$�$�&rwc�,�	|jr|j�|jjr$|jjj	�|js|r|j�|jj|urd|j_	|jrJ�|jj|usJ�y#|js|r|j�|jj|urd|j_wwxYwr�)r�r9rdrS�_cancelr5rQ)rc�try_deactivates  rg�_close_implzRootTransaction._close_impl�
s���
	4��~�~��.�.�0����2�2����3�3�;�;�=��~�~���0�0�2����+�+�t�3�/3����,��>�>�!�!����+�+�4�7�7�7��
�~�~���0�0�2����+�+�t�3�/3����,�4�s
�AC	�	A
Dc�$�|j�yr��r?r�s rgrzRootTransaction._do_close�
s�����rwc�(�|jd��y)NT)r>rAr�s rgrzRootTransaction._do_rollback�
s�������-rwc��|jr�|jj|usJ�	|j�|jjr$|jjj�|j
�d|j_nH|jj|ur|jj�ntjd��|jrJ�|jj|usJ�y#|jjr$|jjj�|j
�wxYw)N�This transaction is inactive)
r�rdrQr;rSr=r5r�rr�r�s rgr zRootTransaction._do_commit�
s����>�>��?�?�/�/�4�7�7�7�	
3��,�,�.�
�?�?�6�6��O�O�7�7�?�?�A��0�0�2�
,0�D�O�O�(����+�+�t�3����4�4�6��-�-�.L�M�M��>�>�!�!����+�+�4�7�7�7��!�?�?�6�6��O�O�7�7�?�?�A��0�0�2�s�D�AENr/r�r�r�)r>r�r�r�)rrrrrrrhr5r	rr2r9r;r?rrr r�rwrgr�r�Z
sU���*�H�+�I��J��8��8�*�)�'�8� �.�8rwr�c�x�eZdZUdZdZded<dd�Zddd�Zedd��Z	dd�Z
						dd	�Zdd
�Zdd�Z
dd�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��
_savepoint�_previous_nestedr|rFc���|j�J�|jrtj|�||_|jj�|_d|_|j|_	||_yr-)
rQrLrr}rdrrFr�rSrGrs  rgrhzNestedTransaction.__init__�
sc���&�&�2�2�2��,�,� �1�1�*�=�$����/�/�9�9�;������ *� >� >���)-�
�&rwc��|jj|ur|j|j_y|rtjd�yy)Nz7nested transaction already deassociated from connection)rdrSrGr!r4)rcr4s  rgr5z-NestedTransaction._deactivate_from_connection�
s=���?�?�.�.�$�6�26�2G�2G�D�O�O�/�
��I�I�I�
�rwc�2�|jj|uSr�)rdrSr�s rgrz.NestedTransaction._deactivated_from_connection�
s�����2�2�$�>�>rwc��d|_|j�|jr|jj�yy�NF)r�r5rGr=r�s rgr=zNestedTransaction._cancels7������(�(�*�� � ��!�!�)�)�+�!rwc��	|jr[|jjrE|jjjr%|jj|j�d|_|r|j|��	|jrJ�|r|jj|usJ�yy#d|_|r|j|��wwxYw)NF)r4)r�rdrQrrFr5rS)rc�deactivate_from_connection�warn_already_deactives   rgr?zNestedTransaction._close_impl	s���	M�����O�O�0�0��O�O�0�0�:�:����;�;�D�O�O�L�"�D�N�)��0�0�6K�0�L��>�>�!�!�%��?�?�6�6�d�B�B�B�&��
#�D�N�)��0�0�6K�0�L�*�s�A'B1�1Cc�(�|jdd�y)NTFrAr�s rgrzNestedTransaction._do_closes������u�%rwc�(�|jdd�yr-rAr�s rgrzNestedTransaction._do_rollback s������t�$rwc�>�|jr>	|jj|j�d|_|j	�y|jj
|ur|jj
�ytjd��#d|_wxYw)NFz#This nested transaction is inactive)	r�rdrrFr5rSr�rr�r�s rgr zNestedTransaction._do_commit#s~���>�>�
'����7�7����H�
"'���
�,�,�.����2�2�d�:����4�4�6��-�-�9����"'���s�%B�	BNr/�T)r4r�r�r�r�r�)rNr�rOr�r�r�)rrrrrrrhr5r	rr=r?rrr r�rwrgr�r��
sg���>N�I��O�.���?��?�,�C�*.�C�GK�C�	
�C�(&�%�rwr�c�T��eZdZUdZdZded<d
�fd�Zdd�Zdd�Zdd�Z	dd	�Z
�xZS)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��_is_preparedrr�c�@��d|_||_t�|�
|�yrL)rUr��superrh)rcrdr��	__class__s   �rgrhzTwoPhaseTransaction.__init__Gs���!������
����$rwc��|jstjd��|jj	|j
�d|_y)zqPrepare this :class:`.TwoPhaseTransaction`.

        After a PREPARE, the transaction can be committed.

        rDTN)r�rr�rdrr�rUr�s rg�preparezTwoPhaseTransaction.prepareLs;���~�~��)�)�*H�I�I����.�.�t�x�x�8� ��rwc�:�|jj|�yr�)rdrr�s rgr2z*TwoPhaseTransaction._connection_begin_implWs�����,�,�T�2rwc�d�|jj|j|j�yr�)rdr#r�rUr�s rgr9z-TwoPhaseTransaction._connection_rollback_implZs �����/�/����$�:K�:K�Lrwc�d�|jj|j|j�yr�)rdr&r�rUr�s rgr;z+TwoPhaseTransaction._connection_commit_impl]s �����-�-�d�h�h��8I�8I�Jrw)rdrHr�rr�)rrrrrrrhrZr2r9r;�
__classcell__)rXs@rgr�r�8s/����(�I�	�H�%�
	!�3�M�Krwr�c�:�eZdZUdZded<ded<eZded<dZd	ed
<eZ	ded<d
Z
ded<dZd	ed<dZded<ded<ded<ded<ded<d	ed<					d1															d2d�Z
d3d�Zed4d��Zd5d �Zd6d!�Zed"d"d"d"d"d#�													d7d$��Zed8d%��Zd8d&�Zd9d'�Zed:d(��Zed:d)��Zej2�Zd:d*�Zd;d<d+�Zej<	d=			d>d,��Zej<d?d-��Z 								d@d.�Z!dAd/�Z"dBd0�Z#y)Cr�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�razType[Connection]�_connection_clszsqlalchemy.engine.Enginer|r�
_is_futureNr�r~zType[OptionEngine]�_option_clsr/rIr6r�r2�urlr�c	��||_||_||_|r||_||_||_|dk7r't
j||j��|_	nd|_	tj||��|r|jdi|��yy)Nr)�
size_alert��echoflagr�)
r�rcrI�logging_name�echor�r!�LRUCache�_lru_size_alertrmr �instance_logger�update_execution_options)	rcr�rIrcrhri�query_cache_sizer�r�s	         rgrhzEngine.__init__�s�����	�������� ,�D����	�.����q� �#'�=�=� �T�-A�-A�$�D� �$(�D� ����D�4�0��)�D�)�)�>�,=�>�rwc��|j�r1|jjdt|�|j�yy)NziCompiled cache size pruning from %d items to %d.  Increase cache size to reduce the frequency of pruning.)r^rorpra�capacity)rc�caches  rgrkzEngine._lru_size_alert�s9��� � �"��K�K���J��E�
����	
�#rwc��|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�s	���rwc�R�|jr|jj�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�clearr�s rg�clear_compiled_cachezEngine.clear_compiled_cache�s$������ � �&�&�(� rwc��|jj||�|jj|�|_|jj||�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�set_engine_execution_optionsrOr�rIr�s  rgrmzEngine.update_execution_options�sE��"	
�
�
�2�2�4��=�"&�"9�"9�"?�"?��"D������1�1�$��<rw.)r�r�r�r�r|c��yr�r�)rcr�r�r�r�r|r�s       rgr�zEngine.execution_options�s��rwc��yr�r�r�s  rgr�zEngine.execution_options�s��=@rwc�&�|j||�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�s��\����c�*�*rwc��|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�.�|jjS)zsString name of the :class:`~sqlalchemy.engine.interfaces.Dialect`
        in use by this :class:`Engine`.

        )rIr�r�s rgr�zEngine.nameBs���|�|� � � rwc�.�|jjS)zsDriver name of the :class:`~sqlalchemy.engine.interfaces.Dialect`
        in use by this :class:`Engine`.

        )rI�driverr�s rgr~z
Engine.driverKs���|�|�"�"�"rwc�"�d|j�d�S)NzEngine(r�)rcr�s rg�__repr__zEngine.__repr__Vs��#�x�x�)�)rwc��|r|jj�|jj�|_|jj	|�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��dispose�recreaterK�engine_disposed)rcr�s  rgr�zEngine.disposeYs>��J��I�I�����I�I�&�&�(��	��
�
�%�%�d�+rwc#�lK�|�|j�5}|��ddd�y|��y#1swYyxYw�wr�)�connect)rcrdr+s   rg�_optional_conn_ctx_managerz!Engine._optional_conn_ctx_manager�s4����������4��
� ���� ��s�4�(�4�1�4c#�K�|j�5}|j�5|��ddd�ddd�y#1swY�xYw#1swYyxYw�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�s:����2�\�\�^�t������
���^�����^�s.�A�A�:�A�	A�A	�A�A�Ac�v�|j�5}|j||fi|��ddd�y#1swYyxYwr�)r�r�)rcr�r�r�r+s     rgr�zEngine._run_ddl_visitor�s0���Z�Z�\�T�!�D�!�!�/�7�E�f�E��\�\�s�/�8c�$�|j|�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�s��.�#�#�D�)�)rwc�6�|jj�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�s��,�y�y� � �"�"rw)NNi�NF)r�r6rIr/rcr2rhr�rizOptional[_EchoFlagType]rnr�r�zOptional[Mapping[str, Any]]r�r�)rqzutil.LRUCache[Any, Any]r�r�)r�r�r��r�rr�r�)r�r�r�r|r�rr�r�r|r�r�rr��OptionEngine)r�rr�r�r�)r�r|rS)r�r�r�r�r�)rdrr��Iterator[Connection])r�r�rr�r�)$rrrrrrErOrarHr`rrar~rhrkr	rUrurmr
r�r�r�r~r �
echo_propertyrir�r��
contextlib�contextmanagerr�r�r�r�rVr�rwrgr�r�asF��� 1�0�0�0�*?���?��K���(2�O�%�2�"<��C�<��J���>B��;�B�#�#�
��
�J�	�H���'+�(,� #�9=� %�?��?��?��	?�
$�?�&�
?��?�7�?��?�8�����)�=�*�7:� �*-�*-�AD�	�4�	��		�
(�	�%(�
	�?�	��	�
�	��	��@��@�N+�`	'��!��!��#��#��3����D�*�(,�T���15��.��	����������8F�D�F��F��	F�

�F�*�2#rwr�c��eZdZUdZded<ded<ded<ded	<d
ed<ded
<ded<				dd�Zdd�Zejs9e	dd��Z
e
jdd��Z
e	dd��Zejdd��Zyy)�OptionEngineMixinFrJrKr�rmr/rIr6r�r2rcr�r�zlog.echo_propertyric��||_|j|_|j|_|j|_|j|_|j
|_|j|_tj||j��|jj|j�|_	|j|_|jdi|��y)Nrfr�)
�_proxiedrcrIrhrirmr�r rlrKr`rOrm)rc�proxiedr�s   rgrhzOptionEngineMixin.__init__�s��� ��
��;�;��������#�0�0����L�L��	�&�6�6���&�6�6������D�4�9�9�5��
�
�+�+�G�,<�,<�=��
�")�"<�"<���%��%�%�:�(9�:rwc��t��r�rr�s  rgrmz*OptionEngineMixin.update_execution_options

rrwc�.�|jjSr��r�r�r�s rgr�zOptionEngineMixin.pool
s���=�=�%�%�%rwc�&�||j_yr�r�)rcr�s  rgr�zOptionEngineMixin.pool
s��!%�D�M�M�rwc�j�|jjxs|jjdd�S)NraF)r�ra�__dict__r}r�s rgrazOptionEngineMixin._has_events
s/���=�=�,�,���
�
�0A�0A��u�1�
rwc�"�||jd<y)Nra)r�)rcr�s  rgrazOptionEngineMixin._has_events!
s��+0�D�M�M�-�(rwN)r�r�r�r.r�)r�r6)r�r6r�r�r�)r�r�r�r�)
rrr�_sa_propagate_class_eventsrrhrm�typing�
TYPE_CHECKINGr	r��setterrar�rwrgr�r��s���!&��0�0�0�0�
��
�J�	�H���
��;��;�2M�;�:$����
�	&�
�	&�
���	&�
�	&�
�	�
�	�

�	�	�	1�
�	1�% rwr�c��eZdZdd�Zy)r�c�0�tj|fi|��yr�)r�rmr�s  rgrmz%OptionEngine.update_execution_options'
s���'�'��4��4rwNr�)rrrrmr�rwrgr�r�&
s��5rwr�)cr�
__future__rr�r�r�rrrrrr	r
rrr
rrrr�
interfacesrrrrrrrr!rrrr�rrr �sqlr"r�r�r#r$r%r&r'r(r)r*r+r,r-r.r/r0�
reflectionr1rcr2�eventr3r4r�r5r6r7r8�sql._typingr9�sql.compilerr:�sql.ddlr;r<r=�
sql.functionsr>�
sql.schemar?r@rA�sql.selectablerBrC�
EMPTY_DICTrErrF�InspectablerHr�rr�r�r��
Identifiedr�r�r�rbr�rwrg�<module>r�s����#��
�
���������������"�.�#�(�$�(�&�$�%�&������"�	�����-�2�1�3�4�2�5�+�-�7�#�2�%��"�#�'��,� �'�'�.�'�)�/�-�*�'�1�
�T����)-�����8� $���
��/�A%O�'��)?�)?��)L�A%O�HJ,'�+�,'�^M�&�M�`i8�k�i8�Xo��o�d&K�/�&K�RA#��C�N�N�J�,B�,B�;�,O�A#�H>1����>1�B5�$�f�5�
"��rw

if you don't want to be vaporized in a nuclear explosion, i simply have to become nuclear myself… i am atomic