PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 131
 ec@sddlmZddlZddlZddlmZddlmZddlmZddlm Z ddlm Z d d l m Z d d l m Z d d l mZd d l mZd dlmZd d lmZejZdefdYZdefdYZde fdYZdefdYZdefdYZdefdYZdefdYZdeejfdYZdefd YZd!eefd"YZee_ dS(#i(twith_statementNi(t Connectable(tExceptionContext(t_distill_params(t_distill_params_20(tTransactionalContexti(texc(t inspection(tlog(tutil(tcompilert ConnectioncBsDeZdZeZdZeZeeeeeeedZ e j dZ dZ dZedZdZdZd Zd Zd Zd Zd ZedZedZedZdZedZdZdZedZedZ e j!dedZ"edZ#dZ$dZ%dZ&dZ'edZ(dZ)ed Z*ed!Z+d"Z,d#Z-d$Z.d%Z/d&Z0d'Z1d(Z2ed)Z3ed*Z4d+Z5d,Z6d-Z7d.Z8d/Z9d0Z:d1Z;d2Z<d3Z=d4Z>d5Z?d6Z@d7ZAeBd8ZCd9ZDd:ZEd;ZFeBd<ZGd=ZHeeBd>ZIeed?ZJd@ZKedAZLdBZMeZNeZOdCZPeQdDZRdEZSe jTdFdGdHZUe jTdFdIdJZVRS(KsProvides high-level functionality for a wrapped DB-API connection. **This is the SQLAlchemy 1.x.x version** of the :class:`_engine.Connection` class. For the :term:`2.0 style` version, which features some API differences, see :class:`_future.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 ssqlalchemy.engine.Connectionc Csr||_|j|_||_|rx|jdks9t||_||_|j|_t|_ ||_ |j |_ n|dk r|n |j |_d|_ |_d|_t|_||_ ||_|jj|_|dkr|j j|j |_ n|p|dko|j |_ | s1t|j|_|j sR|jj rn|j j||dk ndS(sConstruct a new Connection.iN(tenginetdialectt_Connection__branch_fromtNonetAssertionErrort_dbapi_connectiont_execution_optionst_echotFalsetshould_close_with_resulttdispatcht _has_eventstraw_connectiont _transactiont_nested_transactiont_Connection__savepoint_seqt_Connection__in_begint_Connection__can_reconnectt_should_log_infot_jointengine_connect( tselfR t connectiontclose_with_resultt _branch_fromRt _dispatchRt_allow_revalidate((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt__init__Cs6               cs1d|jkr)|jdfdSdSdS(Nt logging_tokencsd|fS(Ns[%s] %s((tmsg(ttoken(sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt~t(RR(R!((R*sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_message_formatterzs  cOsX|j}|r||}ntjr;dtj|d` :ref:`PostgreSQL Transaction Isolation ` :ref:`MySQL Transaction Isolation ` :ref:`SQL Server Transaction Isolation ` :ref:`session_transaction_isolation` - for the ORM :param no_parameters: 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: Connection, statement. 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 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 schema_translate_map: Available on: :class:`_engine.Connection`, :class:`_engine.Engine`, :class:`_sql.Executable`. :param schema_translate_map: Available on: Connection, Engine. 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. .. versionadded:: 1.1 .. seealso:: :ref:`schema_translating` .. seealso:: :meth:`_engine.Engine.execution_options` :meth:`.Executable.execution_options` :meth:`_engine.Connection.get_execution_options` (RJRtunionRR Rt set_connection_execution_optionsR (R!toptRI((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pytexecution_optionss cCs|jS(sGet the non-SQL options which will take effect during execution. .. versionadded:: 1.3 .. seealso:: :meth:`_engine.Connection.execution_options` (R(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pytget_execution_optionss cCs|jdko|j S(s)Return True if this connection is closed.N(RRR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pytclosedscCs*|jr|jjS|jdko)|j S(s/Return True if this connection was invalidated.N(Rt invalidatedRRRV(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRWs  cCsy|jdkrny|jSWqutjtjfk r?qutk rj}|j|ddddquXn|jSdS(sVThe 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(RRt_revalidate_connectionRtPendingRollbackErrortResourceClosedErrort BaseExceptiont_handle_dbapi_exception(R!te((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR"s cCsJy|jj|jSWn,tk rE}|j|ddddnXdS(sReturn 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. .. versionadded:: 0.9.9 .. 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(R tget_isolation_levelR"R[R\R(R!R]((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR^!s'cCs |jjS(sThe 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. .. versionadded:: 0.9.9 .. 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 (R tdefault_isolation_level(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR_MscCs||jr:tjd|jdk r'dndddn>|j sJttjd|jdk rhdnddddS(Ns;Can't reconnect until invalid %stransaction is rolled back.s savepoint R,tcodet8s2bs\This connection is on an inactive %stransaction. Please rollback() fully before proceeding.t8s2a(RWRRYRRRDR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_invalid_transactionls  cCsv|jr|jjS|jrc|jrc|jdk rD|jn|jjd||_ |j St j ddS(Nt _connectionsThis Connection is closed( RRXRRWRRRcR RRRRZ(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRXs     cCs"|jdk o!t|jdtS(Ntis_valid(RRtgetattrR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt)_still_open_and_dbapi_connection_is_validscCs |jjS(sInfo 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`. (R"R2(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR2s s:meth:`.Connection.connect`cCs |jS(sReturns a branched version of this :class:`_engine.Connection`. The :meth:`_engine.Connection.close` method on the returned :class:`_engine.Connection` can be called and this :class:`_engine.Connection` will remain open. This method provides usage symmetry with :meth:`_engine.Engine.connect`, including for usage with context managers. (RC(R!R#((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pytconnectscCsm|jr|jjd|S|jr)dS|jrDtjdn|jr`|jj|nd|_dS(sInvalidate 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` t exceptionNsThis Connection is closed( Rt invalidateRWRVRRZRgRR(R!Ri((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRjs.    cCs|jjdS(s2Detach 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). N(Rtdetach(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRkscCs|jdS(N(tbegin(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt _autobegin scCs|jr|j s2tn|jr2|jjS|jr?dS|jdkrdt||_|jS|jrtj dn t |SdS(sBegin a transaction and return a transaction handle. The returned object is an instance of :class:`.Transaction`. This object represents the "scope" of the transaction, which completes when either the :meth:`.Transaction.rollback` or :meth:`.Transaction.commit` method is called. .. tip:: The :meth:`_engine.Connection.begin` method is invoked when using the :meth:`_engine.Engine.begin` context manager method as well. All documentation that refers to behaviors specific to the :meth:`_engine.Connection.begin` method also apply to use of the :meth:`_engine.Engine.begin` method. Legacy use: nested calls to :meth:`.begin` on the same :class:`_engine.Connection` will return new :class:`.Transaction` objects that represent an emulated transaction within the scope of the enclosing transaction, that is:: trans = conn.begin() # outermost transaction trans2 = conn.begin() # "nested" trans2.commit() # does nothing trans.commit() # actually commits Calls to :meth:`.Transaction.commit` only have an effect when invoked via the outermost :class:`.Transaction` object, though the :meth:`.Transaction.rollback` method of any of the :class:`.Transaction` objects will roll back the transaction. .. tip:: The above "nesting" behavior is a legacy behavior specific to :term:`1.x style` use and will be removed in SQLAlchemy 2.0. For notes on :term:`2.0 style` use, see :meth:`_future.Connection.begin`. .. seealso:: :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` NsThis connection has already initialized a SQLAlchemy Transaction() object via begin() or autobegin; can't call begin() here unless rollback() or commit() is called first.( RDRRRlRRRtRootTransactionRtInvalidRequestErrortMarkerTransaction(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRls3      cCsx|jr|j s2tn|jr2|jjS|jdkrn|jsatjd|jS|j nt |S(sBegin a nested transaction (i.e. SAVEPOINT) and return a transaction handle, assuming an outer transaction is already established. Nested transactions require SAVEPOINT support in the underlying database. Any transaction in the hierarchy may ``commit`` and ``rollback``, however the outermost transaction still controls the overall ``commit`` or ``rollback`` of the transaction of a whole. The legacy form of :meth:`_engine.Connection.begin_nested` method has alternate behaviors based on whether or not the :meth:`_engine.Connection.begin` method was called previously. If :meth:`_engine.Connection.begin` was not called, then this method will behave the same as the :meth:`_engine.Connection.begin` method and return a :class:`.RootTransaction` object that begins and commits a real transaction - **no savepoint is invoked**. If :meth:`_engine.Connection.begin` **has** been called, and a :class:`.RootTransaction` is already established, then this method returns an instance of :class:`.NestedTransaction` which will invoke and manage the scope of a SAVEPOINT. .. tip:: The above mentioned behavior of :meth:`_engine.Connection.begin_nested` is a legacy behavior specific to :term:`1.x style` use. In :term:`2.0 style` use, the :meth:`_future.Connection.begin_nested` method instead autobegins the outer transaction that can be committed using "commit-as-you-go" style; see :meth:`_future.Connection.begin_nested` for migration details. .. versionchanged:: 1.4.13 The behavior of :meth:`_engine.Connection.begin_nested` as returning a :class:`.RootTransaction` if :meth:`_engine.Connection.begin` were not called has been restored as was the case in 1.3.x versions; in previous 1.4.x versions, an outer transaction would be "autobegun" but would not be committed. .. seealso:: :meth:`_engine.Connection.begin` :ref:`session_begin_nested` - ORM support for SAVEPOINT s(Calling Connection.begin_nested() in 2.0 style use will return a NestedTransaction (SAVEPOINT) in all cases, that will not commit the outer transaction. For code that is cross-compatible between 1.x and 2.0 style use, ensure Connection.begin() is called before calling Connection.begin_nested().N( RDRRt begin_nestedRRR twarn_deprecated_20RlRmtNestedTransaction(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRq\s0      cCsk|jr|jjd|S|jdk r=tjdn|dkr^|jjj}nt ||S(s'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` txidsOCannot start a two phase transaction when a transaction is already in progress.N( Rtbegin_twophaseRRRRoR R t create_xidtTwoPhaseTransaction(R!Rt((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRus   cCs|jjj|S(N(R R tdo_recover_twophase(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pytrecover_twophasescCs |jjj||d|dS(Ntrecover(R R tdo_rollback_twophase(R!RtRz((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pytrollback_preparedscCs |jjj||d|dS(NRz(R R tdo_commit_twophase(R!RtRz((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pytcommit_preparedscCs5|jdk r|jjS|jdk o4|jjS(s,Return True if a transaction is in progress.N(RRtin_transactionRt is_active(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRs cCs5|jdk r|jjS|jdk o4|jjS(s,Return True if a transaction is in progress.N(RRtin_nested_transactionRR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRs cCsO|jjdd}t|dkpK|dkoKt|jjdddkS(Ntisolation_levelt AUTOCOMMIT(RR;RtboolRfR R (R!topt_iso((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_is_autocommit_isolations   cCs#|jdk r|jjS|jS(saReturn the current root transaction in progress, if any. .. versionadded:: 1.4 N(RRtget_transactionR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRs cCs#|jdk r|jjS|jS(scReturn the current nested transaction in progress, if any. .. versionadded:: 1.4 N(RRtget_nested_transactionR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRs cCs|j st|jrE|jr5|jdqE|jdnt|_|jsc|jjrv|j j |nzMy|jj j |j Wn,tk r}|j|ddddnXWdt|_XdS(Ns?BEGIN (implicit; DBAPI should not BEGIN due to autocommit mode)sBEGIN (implicit)(RRRRR7tTrueRRR RRlR tdo_beginR"R[R\RR(R!t transactionR]((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt _begin_impls    !cCs|j st|js%|jjr8|jj|n|jr|jrv|jrf|j dqv|j dny|jj j |j Wqt k r}|j|ddddqXndS(NsVROLLBACK using DBAPI connection.rollback(), DBAPI should ignore due to autocommit modetROLLBACK(RRRR RtrollbackRgRRR7R t do_rollbackR"R[R\R(R!R]((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_rollback_impls    cCs|j st|r3|j r3tjdn|jsH|jjr[|jj|n|j r|jr|j dq|j dny|jj j |j Wn,tk r}|j|ddddnXdS(NsThe current statement is being autocommitted using implicit autocommit, which will be removed in SQLAlchemy 2.0. Use the .begin() method of Engine or Connection in order to use an explicit transaction for DML and DDL statements.sRCOMMIT using DBAPI connection.commit(), DBAPI should ignore due to autocommit modetCOMMIT(RRRR RrRR RtcommitRR7R t do_commitR"R[R\R(R!t autocommitR]((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt _commit_impl*s    cCs|j st|js%|jjr;|jj||n|dkrf|jd7_d|j}n|jr|jj j |||SdS(Nissa_savepoint_%s( RRRR Rt savepointRRRgR t do_savepoint(R!R@((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_savepoint_implJs  cCsd|j st|js%|jjr>|jj||dn|jr`|jjj ||ndS(N( RRRR Rtrollback_savepointRRgR tdo_rollback_to_savepoint(R!R@((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_rollback_to_savepoint_implWs  cCsd|j st|js%|jjr>|jj||dn|jr`|jjj ||ndS(N( RRRR Rtrelease_savepointRRgR tdo_release_savepoint(R!R@((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_release_savepoint_impl`s  cCs|j st|jr)|jdn|js>|jjrW|jj||jn|j rt |_ zPy|jj j ||jWn,tk r}|j|ddddnXWdt|_ XndS(NsBEGIN TWOPHASE (implicit)(RRRR7RR RRuRtRgRRR tdo_begin_twophaseR[R\RR(R!RR]((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_begin_twophase_implis   !cCs|j st|js%|jjr;|jj||n|jrt|jt s\ty|jj j ||Wqt k r}|j |ddddqXndS(N(RRRR Rtprepare_twophaseRgt isinstanceRRwR tdo_prepare_twophaseR[R\R(R!RtR]((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_prepare_twophase_implzs cCs|j st|js%|jjr>|jj|||n|jrt|jt s_ty|jj j |||Wqt k r}|j |ddddqXndS(N(RRRR Rtrollback_twophaseRgRRRwR R{R[R\R(R!Rtt is_preparedR]((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_rollback_twophase_impls  cCs|j st|js%|jjr>|jj|||n|jrt|jt s_ty|jj j |||Wqt k r}|j |ddddqXndS(N(RRRR Rtcommit_twophaseRgRRRwR R}R[R\R(R!RtRR]((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_commit_twophase_impls cCs6|jr|jjn|js2|jndS(N(Rt _autorollbackRR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRs  cCstjddS(Ns The connection.execute() method in SQLAlchemy 2.0 will accept parameters as a single dictionary or a single sequence of dictionaries only. Parameters passed as keyword arguments, tuples or positionally oriented dictionaries and/or tuples will no longer be accepted.(R Rr(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_warn_for_legacy_exec_formatscCs|jr<|j sttjdd|_t|_dS|j r[|j j t }nt}|jdk r|j}|r|j dt n |j d|_nt|_dS(sfClose 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`. After :meth:`_engine.Connection.close` is called, the :class:`_engine.Connection` is permanently in a closed state, and will allow no further operations. sThe .close() method on a so-called 'branched' connection is deprecated as of 1.4, as are 'branched' connections overall, and will be removed in a future release. If this is a default-handling function, don't close the connection.Nttransaction_reset( RRDRR RrRRRRRRLRt_close_special(R!t skip_resettconn((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRLs$         cOs|j|||jS(sExecutes and returns the first column of the first row. The underlying result/cursor is closed after execution. (texecutetscalar(R!tobject_t multiparamstparams((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRscOs|j|||jS(sExecutes 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 (Rtscalars(R!RRR((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRscOst|tjr;tjd|j|||tdtSy |j}Wn/tk ry}tj t j |d|nX||||tSdS(sY Executes a SQL statement construct and returns a :class:`_engine.CursorResult`. :param statement: The statement to be executed. May be one of: * a plain string (deprecated) * any :class:`_expression.ClauseElement` construct that is also a subclass of :class:`.Executable`, such as a :func:`_expression.select` construct * a :class:`.FunctionElement`, such as that generated by :data:`.func`, will be automatically wrapped in a SELECT statement, which is then executed. * a :class:`.DDLElement` object * a :class:`.DefaultGenerator` object * a :class:`.Compiled` object .. deprecated:: 2.0 passing a string to :meth:`_engine.Connection.execute` is deprecated and will be removed in version 2.0. Use the :func:`_expression.text` construct with :meth:`_engine.Connection.execute`, or the :meth:`_engine.Connection.exec_driver_sql` method to invoke a driver-level SQL string. :param \*multiparams/\**params: represent bound parameter values to be used in the execution. Typically, the format is either a collection of one or more dictionaries passed to \*multiparams:: conn.execute( table.insert(), {"id":1, "value":"v1"}, {"id":2, "value":"v2"} ) ...or individual key/values interpreted by \**params:: conn.execute( table.insert(), id=1, value="v1" ) In the case that a plain SQL string is passed, and the underlying DBAPI accepts positional bind parameters, a collection of tuples or individual values in \*multiparams may be passed:: conn.execute( "INSERT INTO table (id, value) VALUES (?, ?)", (1, "v1"), (2, "v2") ) conn.execute( "INSERT INTO table (id, value) VALUES (?, ?)", 1, "v1" ) Note above, the usage of a question mark "?" or other symbol is contingent upon the "paramstyle" accepted by the DBAPI in use, which may be any of "qmark", "named", "pyformat", "format", "numeric". See `pep-249 `_ for details on paramstyle. To execute a textual SQL statement which uses bound parameters in a DBAPI-agnostic way, use the :func:`_expression.text` construct. .. deprecated:: 2.0 use of tuple or scalar positional parameters is deprecated. All params should be dicts or sequences of dicts. Use :meth:`.exec_driver_sql` to execute a plain string with tuple or scalar positional parameters. sPassing a string to Connection.execute() is deprecated and will be removed in version 2.0. Use the text() construct, or the Connection.exec_driver_sql() method to invoke a driver-level SQL string.tfuturetreplace_contextN( RR t string_typesRrt_exec_driver_sqlt_EMPTY_EXECUTION_OPTSRt_execute_on_connectiontAttributeErrortraise_RtObjectNotExecutableError(R!t statementRRtmethterr((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRsK cCs|j|j|||S(s%Execute a sql.FunctionElement object.(t_execute_clauseelementtselect(R!tfuncRRRT((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_execute_functionkscCs]|jj|}t|||}|js9|jjr]|j|||\}}}}nyL|j} | dkr|j} n|j } | j j | || |} WnKt j t jfk rn,tk r} |j| ddddnX| jd|d} |jr"|jn|js7|jjrY|jj|||||| n| S(s&Execute a schema.ColumnDefault object.N(Rt merge_withRRR t_invoke_before_exec_eventRRRXR texecution_ctx_clst _init_defaultRRYRZR[R\t _exec_defaultRRLRt after_execute(R!tdefaultRRRTtdistilled_parameterstdistilled_paramstevent_multiparamst event_paramsRR tctxR]tret((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_execute_defaultrs:          cCs|jj|j|}t|||}|js?|jjrc|j|||\}}}}n|jj|} | jdd} |j} |j d| d| } |j | | j j | d|| } |js|jjr|j j|||||| n| S(sExecute a schema.DDL object.R:R N(RRRRR RR;RR tcompilet_execute_contextRt _init_ddlRR(R!tddlRRRTRRRRt exec_optsR:R tcompiledR((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt _execute_ddls6       cCst|dkr&g|d}}n |i}}x5|jjD]'}||||||\}}}q@W|rt|}|rtjdqn|r|g}ng}||||fS(NiisLEvent handler can't return non-empty multiparams and params at the same time(tlenRtbefore_executetlistRRo(R!telemRRTRRtfn((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRs&   cCsx|jj|j|}t|||}|jp<|jj}|ri|j|||\}}}}n|rt|d} t|dk} n g} t} |j } |j dd } |j d|jj } |j d| d| d| d| d| d|j jtjB\}}}|j| | jj|||||||d | }|rt|jj||||||n|S( s#Execute a sql.ClauseElement object.iiR:tcompiled_cacheR t column_keystfor_executemanytlintingt cache_hitN(RRRRR RtsortedRRR R;Rt_compiled_cachet_compile_w_cachetcompiler_lintingR t WARN_LINTINGRRt_init_compiledRR(R!RRRRTRt has_eventsRRtkeysRR R:Rt compiled_sqltextracted_paramsRR((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRsX        c Cs|jj|j|}t|||}|js?|jjrc|j|||\}}}}n|j} |j| | j j |||||dd } |js|jjr|j j |||||| n| S(siExecute a sql.Compiled object. TODO: why do we have this? likely deprecate or remove N(RTRRRRR RR RRRRRR( R!RRRRTRRRRR R((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_execute_compiled@s4      c Cs|jj|}t|||}|sf|js?|jjrf|j|||\}}}} qfn|j} |j| | jj |||||} |s|js|jjr|j j |||| || qn| S(N( RRRRR RR RRt_init_statementRR( R!RRRRTRRRRRR R((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRts4  !     cCsht|\}}y |j}Wn/tk rP}tjtj|d|nX|||||SdS(NR(RRRR RRR(R!Rt parametersRTt args_10styletkwargs_10styleRR((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt _execute_20s cCs.t|\}}|j||||dtS(sWExecutes 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` R(RRR(R!RRRTRR((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pytexec_driver_sqls8c Os|}|jr|j}n|r\|jdd } | r\|jitd6| d6}q\nyC|j} | d kr|j} n|||| |||} WnTtjtj fk rn5t k r} |j | t j ||d d nX|jr |jj s"|jr/|jj r/|jn|jrHtj|n|jrm|jd krm|jn| j|jr| jn| j| j| j} }}| js|d}n|js|jjrx;|j j!D]*}||| ||| | j\}}qWn|j"r|j#|| j$}|jj%so|j#d|t&j'|ddd| jq|j#d |fnt(}y3| jr|j)jrx9|j)j j*D]%}|| ||| rt}PqqWn|s|j)j*| ||| qn| r|| j+r||j)jrZx6|j)j j,D]"}|| || r1t}Pq1q1Wn|s|j)j,| || qnj|j)jrx9|j)j j-D]%}|| ||| rt}PqqWn|s|j)j-| ||| n|js|jjr |j j.|| ||| | jn| j/| j0}|js|j1}|j2 rd|rdt|_3n|jd kr| j4r|j5d tn|r| j2r|j st6|j7qnWn,t k r} |j | ||| | nX|S( sdCreate an :class:`.ExecutionContext` and execute, returning a :class:`_engine.CursorResult`.t yield_pertstream_resultstmax_row_bufferis[%s] %rtbatchesi tismultis8[%s] [SQL parameters hidden due to hide_parameters=True]RN(8RR;RRQRRRXRRYRZR[R\R t text_typeRRRRct_trans_context_managerRt_trans_ctx_checkRDRmtpre_exectuse_setinputsizest_set_input_sizestcursorRRt executemanyRR Rtbefore_cursor_executeRR7t_get_cache_statsthide_parameterstsql_utilt _repr_paramsRR tdo_executemanyt no_parameterstdo_execute_no_paramst do_executetafter_cursor_executet post_exect_setup_result_proxyRt _soft_closedt_autoclose_connectiontshould_autocommitRRRL(R!R t constructorRRRTtargsR5tbranchedtypRtcontextR]RRtstatst evt_handledtresultR((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRs                                        cCsE|js|jjrPx8|jjD]'}||||||t\}}q"Wn|jry|j||jd|nybx[|jjsdn |jjjD]}|||||rPqqW|jj||||Wn,t k r }|j |||||nX|js|jjrA|jj |||||tndS(s_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(). s [raw sql] %rN(( RR RRRRR7R R R[R\R (R!RRRRRR]((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_cursor_executes( %   cCsBy|jWn-tk r=|jjjjddtnXdS(s\Close the given cursor, catching exceptions and turning into log warnings. sError closing cursortexc_infoN(RLt ExceptionR tpoolR1terrorR(R!R((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_safe_close_cursors  cCstj}tj|}|jst||jjjrp|j rp|jj ||j sd|j nd|p}|o}|j |_n| }|jrtjtjj||||jjjd|jjd|jd|dk r|jndd|dd|nt|_zot||jjjpD|dk oD|dkoD| } | rtjj||||jjjd|jjd|jd|jd|dk r|jnd} nd} d} |js|jjr|jjdt rt|| |j||||||j| } x]|jjD]O} y,| | }|dk rO|| _} nWqtk rl}|} PqXqW|j| j kr| j |_| r| j | _ qn| j!}n| r|r|j"|n|js|r|j#|ntj$d t|j%WdQXn| r:tj| d|dd|nA| r`tj| d|dd|ntj|d d|dWd|`|jr|`|j s|j }|r|jj&j'||n|j(|qn|j)r|j* st+|j,nXdS( NRR Rtwith_tracebackitfrom_tconnection_invalidatedtskip_user_error_eventst warn_onlyi(-tsysRR tis_exit_exceptiont_is_disconnectRR tdbapitErrorRVt is_disconnectRWRRt_reentrant_errorRRt DBAPIErrortinstanceR RRRRRR;RtExceptionContextImplRt handle_errortchained_exceptionRR"tinvalidate_pool_on_disconnectthandle_dbapi_exceptionRt safe_reraiseRRt _invalidateRjRRDRRL(R!R]RRRRRR&R1t should_wraptsqlalchemy_exceptiontnewraiseRRtper_fnt_raisedtdbapi_conn_wrapper((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR\s                                   c Cstj}|j|dd}t||jj}|rotjj dd||jjd|j d|}nd}d}|j r6t |||ddddd|t } x]|jjD]O} y,| | } | dk r| | _}nWqtk r} | }PqXqW|r6|| jkr6| j|_}q6n|r\tj|d|dd|nA|rtj|d|dd|ntj|dd|ddS(NRR"R iR!i(R%RR*RRR(R)RR,R-RRR.RRR/R0RR"R R( tclsR]R R RR*R5R6R7RRR8R9((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt$_handle_dbapi_exception_noconnectionisR           cKs ||j||j|dS(srun 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(R ttraverse_single(R!tvisitorcallabletelementtkwargs((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_run_ddl_visitorss1.4sThe :meth:`_engine.Connection.transaction` method is deprecated and will be removed in a future release. Use the :meth:`_engine.Engine.begin` context manager instead.cOsht|d<|j}y'|j|||}|j|SWn$tj|jWdQXnXdS(stExecute the given function within a transaction boundary. The function is passed this :class:`_engine.Connection` as the first argument, followed by the given \*args and \**kwargs, e.g.:: def do_something(conn, x, y): conn.execute(text("some statement"), {'x':x, 'y':y}) conn.transaction(do_something, 5, 10) The operations inside the function are all invoked within the context of a single :class:`.Transaction`. Upon success, the transaction is committed. If an exception is raised, the transaction is rolled back before propagating the exception. .. note:: The :meth:`.transaction` method is superseded by the usage of the Python ``with:`` statement, which can be used with :meth:`_engine.Connection.begin`:: with conn.begin(): conn.execute(text("some statement"), {'x':5, 'y':10}) As well as with :meth:`_engine.Engine.begin`:: with engine.begin() as conn: conn.execute(text("some statement"), {'x':5, 'y':10}) .. seealso:: :meth:`_engine.Engine.begin` - engine-level transactional context :meth:`_engine.Engine.transaction` - engine-level version of :meth:`_engine.Connection.transaction` t_sa_skip_warningN(RRlt run_callableRR R3R(R!t callable_RR@ttransR((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRs1    sThe :meth:`_engine.Connection.run_callable` method is deprecated and will be removed in a future release. Invoke the callable function directly, passing the Connection.cOs||||S(sGiven a callable object or function, execute it, passing a :class:`_engine.Connection` as the first argument. The given \*args and \**kwargs are passed subsequent to the :class:`_engine.Connection` argument. This function, along with :meth:`_engine.Engine.run_callable`, allows a function to be run with a :class:`_engine.Connection` or :class:`_engine.Engine` object without the need to know which one is being dealt with. ((R!RDRR@((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRCs(Wt__name__t __module__t__doc__RRDt_sqla_logger_namespaceRRRR'R tmemoized_propertyR-R7R9tpropertyR<RARCRJRKRPRTRURVRWR"R^R_RcRXRgR2t deprecated_20RhRjRkRmRlRqRuRyR|R~RRRRRRRRRRRRRRRRRRLRRRRRRRRRRRRRRRRR+R'R\t classmethodR<RAt deprecatedRRC(((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR s .         ,    ;   M E          7  e 2 . M / / A (  = 9R.cBseZdZdZRS(s3Implement the :class:`.ExceptionContext` interface.c CsU||_||_||_||_||_||_||_| |_| |_dS(N( R R"R6toriginal_exceptiontexecution_contextRRR*R1( R!RiR6R R"RRRRR*R1((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR' s        (RFRGRHR'(((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR. st TransactioncBseZdZdZeZdZdZedZ dZ dZ dZ edZ dZd Zd Zd Zd Zd ZdZRS(stRepresent 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://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 cCs tdS(N(tNotImplementedError(R!R"((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR'E scCs tdS(sdo whatever steps are necessary to set this transaction as "deactive", however leave this transaction object in place as far as the connection's state. for a "real" transaction this should roll back the transaction and ensure this transaction is no longer a reset agent. this is used for nesting of marker transactions where the marker can set the "real" transaction as rolled back, however it stays in place. for 2.0 we hope to remove this nesting feature. N(RR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_do_deactivateH scCs tdS(sTrue if this transaction is totally deactivated from the connection and therefore can no longer affect its state. N(RR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_deactivated_from_connectionY scCs tdS(N(RR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt _do_closea scCs tdS(N(RR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt _do_rollbackd scCs tdS(N(RR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt _do_commitg scCs|jo|jj S(N(RR"RW(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRej scCs&z|jWd|j s!tXdS(s;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(RURR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRLn s cCs&z|jWd|j s!tXdS(sRoll 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(RVRR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR~ scCs&z|jWd|j s!tXdS(sCommit 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(RWRR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR scCs|jS(N(R"(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt _get_subject scCs|jS(N(R(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_transaction_is_active scCs|j S(N(RT(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_transaction_is_closed scCstS(N(R(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_rollback_can_be_called s((RFRGRHt __slots__Rt_is_rootR'RSRKRTRURVRWReRLRRRXRYRZR[(((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRQ s"#           RpcBs_eZdZd ZdZedZedZdZdZ d Z d Z RS( sA 'marker' transaction that is used for nested begin() calls. .. deprecated:: 1.4 future connection for 2.0 won't support this pattern. R"t _is_activeRcCs|jdk st|jjs3tjdn|j sCttjd||_ |j rrt j |n|j dk r|j |_n |j|_t|_dS(NsWthe current transaction on this connection is inactive. Please issue a rollback first.sCalling .begin() when a transaction is already begun, creating a 'sub' transaction, is deprecated and will be removed in 2.0. See the documentation section 'Migrating from the nesting pattern' for background on how to migrate from this pattern.(RRRRRRoRDR RrR"RRRRRR^(R!R"((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR' s     cCs|j S(N(R(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRT scCs|jo|jjS(N(R^RR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR scCs t|_dS(N(RR^(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt _deactivate scCs|jdS(N(R_(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRU scCs/|jr+z|jjWd|jXndS(N(R^RRSR_(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRV s cCs|jdS(N(R_(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRW s(R"R^R( RFRGRHR\R'RKRTRR_RURVRW(((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRp s    RncBseZdZeZdZdZdZedZ dZ dZ dZ d Z ed Zd Zd Zd ZRS(sRepresent 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:`_future.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:`_future.Connection.commit` and :meth:`_future.Connection.rollback` methods. R"RcCsW|jdkst|jr.tj|n||_|j||_t|_ dS(N( RRRRRRR"t_connection_begin_implRR(R!R"((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR' s    cCsS|jr-|jj|ks!tt|_n"|jj|k rOtjdndS(Ns0transaction already deassociated from connection(RR"RRRR twarn(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_deactivate_from_connection s   cCs|jj|k S(N(R"R(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRT& scCs[|jj|kst|jr.|jn|jjrM|jjjn|jdS(N(R"RRRt_connection_rollback_implRt_cancelRb(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRS* s    cCs|jj|dS(N(R"R(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR`? scCs|jjdS(N(R"R(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRcB scCs|jjdS(N(R"R(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_connection_commit_implE scCsz9|jr|jn|jjr8|jjjnWd|jsK|rX|jn|jj|kryd|j_nX|j st|jj|k stdS(N( RRcR"RRdRbRRR(R!ttry_deactivate((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt _close_implH s    cCs|jdS(N(Rg(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRUX scCs|jdtdS(NRf(RgR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRV[ scCs|jrk|jj|ks!tz|jWd|jjrQ|jjjn|jXd|j_n1|jj|kr|jj nt j d|j st|jj|k stdS(NsThis transaction is inactive( RR"RRReRRdRbRRcRRo(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRW^ s   (R"R(RFRGRHRR]R\R'RbRKRTRSR`RcReRRgRURVRW(((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRn s        RscBsneZdZdZdZedZedZdZ d Z d Z d Z d Z d ZRS(sRepresent 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. R"Rt _savepointt_previous_nestedcCsk|jdk st|jr.tj|n||_|jj|_t |_ |j |_ ||_ dS(N( RRRRRRR"RRhRRRRi(R!R"((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR' s    cCs>|jj|kr$|j|j_n|r:tjdndS(Ns7nested transaction already deassociated from connection(R"RRiR Ra(R!Ra((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRb s cCs|jj|k S(N(R"R(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRT scCs0t|_|j|jr,|jjndS(N(RRRbRiRd(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRd s   cCsz2|jr1|jjjr1|jj|jnWdt|_|rW|jd|nX|j sht|r|jj|k stndS(NRa( RR"RRRhRRbRR(R!tdeactivate_from_connectiontwarn_already_deactive((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRg s cCs|jttdS(N(RgR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRS scCs|jttdS(N(RgRR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRU scCs|jttdS(N(RgR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRV scCso|jr:z|jj|jWdt|_X|jn1|jj|kr\|jjntj ddS(Ns#This nested transaction is inactive( RR"RRhRRbRRcRRo(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRW s   (R"RRhRi(RFRGRHR\R'RRbRKRTRdRgRSRURVRW(((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRs{ s     RwcBsAeZdZd ZdZdZdZdZd ZRS( sRepresent 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"RRtt _is_preparedcCs,t|_||_tt|j|dS(N(RRlRttsuperRwR'(R!R"Rt((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR' s  cCs;|jstjdn|jj|jt|_dS(sqPrepare this :class:`.TwoPhaseTransaction`. After a PREPARE, the transaction can be committed. sThis transaction is inactiveN(RRRoR"RRtRRl(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pytprepare s cCs|jj|dS(N(R"R(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR` scCs|jj|j|jdS(N(R"RRtRl(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRc scCs|jj|j|jdS(N(R"RRtRl(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRe s(R"RRtRl( RFRGRHR\R'RnR`RcRe(((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRw s    tEnginecBseZdZeZeZeZdZ eZ d)Z d)d)dd)edZ dZedZdZdZdZd Zed Zed ZejZd Zed Zd*ejdZe j!d)dZ"de#fdYZ$edZ%ej&dddZ'ej&dddZ(dZ)ej*ddddZ+ej*ddddZ,d)d)ed Z-ed!Z.ed"Z/ej&dd#d)d)d$Z0ej&dd%d)d&Z1d'Z2d)d(Z3RS(+s9 Connects a :class:`~sqlalchemy.pool.Pool` and :class:`~sqlalchemy.engine.interfaces.Dialect` together to provide a source of database connectivity and behavior. This is the **SQLAlchemy 1.x version** of :class:`_engine.Engine`. For the :term:`2.0 style` version, which includes some API differences, see :class:`_future.Engine`. An :class:`_engine.Engine` object is instantiated publicly using the :func:`~sqlalchemy.create_engine` function. .. seealso:: :doc:`/core/engines` :ref:`connections_toplevel` ssqlalchemy.engine.Engineic Cs||_||_||_|r-||_n||_||_|dkritj|d|j|_ n d|_ t j |d||r|j |ndS(Nit size_alerttechoflag(RturlR t logging_nametechoRR tLRUCachet_lru_size_alertRRRtinstance_loggertupdate_execution_options( R!RR RrRsRttquery_cache_sizeRTR((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR', s        cCs/|jr+|jjdt||jndS(NsiCompiled cache size pruning from %d items to %d. Increase cache size to reduce the frequency of pruning.(RR1R2Rtcapacity(R!tcache((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRvH s    cCs|S(N((R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR Q scCs|jr|jjndS(sClear 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.query_cache` parameter. .. versionadded:: 1.4 N(Rtclear(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pytclear_compiled_cacheU s cKs?|jj||_|jj|||jj||dS(sUpdate 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(RRQRtset_engine_execution_optionsR (R!RS((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRxc scKs|j||S(s Return 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 "sharding" schemes where multiple :class:`_engine.Engine` objects refer to the same connection pool, but are differentiated by options that would be consumed by a custom event:: primary_engine = create_engine("mysql://") shard1 = primary_engine.execution_options(shard_id="shard1") shard2 = primary_engine.execution_options(shard_id="shard2") Above, the ``shard1`` engine serves as a factory for :class:`_engine.Connection` objects that will contain the execution option ``shard_id=shard1``, and ``shard2`` will produce :class:`_engine.Connection` objects that contain the execution option ``shard_id=shard2``. An event handler can consume the above execution option to perform a schema switch or other operation, given a connection. Below we emit a MySQL ``use`` statement to switch databases, at the same time keeping track of which database we've established using the :attr:`_engine.Connection.info` dictionary, which gives us a persistent storage space that follows the DBAPI connection:: from sqlalchemy import event from sqlalchemy.engine import Engine 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._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 .. 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` (t _option_cls(R!RS((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRTx sJcCs|jS(sGet the non-SQL options which will take effect during execution. .. versionadded: 1.3 .. seealso:: :meth:`_engine.Engine.execution_options` (R(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRU s cCs |jjS(siString name of the :class:`~sqlalchemy.engine.interfaces.Dialect` in use by this :class:`Engine`.(R R@(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR@ scCs |jjS(siDriver name of the :class:`~sqlalchemy.engine.interfaces.Dialect` in use by this :class:`Engine`.(R tdriver(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR scCsd|jfS(Ns Engine(%r)(Rr(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt__repr__ scCs<|r|jjn|jj|_|jj|dS(sDispose 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(RtdisposetrecreateRtengine_disposed(R!RL((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR s%cCs,|j}|j|||SWdQXdS(N(RhR(R!RRRR((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR sccs2|dkr)|j }|VWdQXn|VdS(N(RRh(R!R"R((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_optional_conn_ctx_manager s t _trans_ctxcBs#eZdZdZdZRS(cCs||_||_||_dS(N(RRR#(R!RRR#((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR' s  cCs|jj|jS(N(RRKR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRK s cCs;z|jj|||Wd|js6|jjnXdS(N(RRPR#RRL(R!RMRNRO((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRP$ s (RFRGR'RKRP(((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR s  cCsw|jjr|j}n|jd|}y|j}Wn$tj|jWdQXnXtj|||S(sXReturn 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. Legacy use only: the ``close_with_result`` flag is normally ``False``, and indicates that the :class:`_engine.Connection` will be closed when the operation is complete. When set to ``True``, it indicates the :class:`_engine.Connection` is in "single use" mode, where the :class:`_engine.CursorResult` returned by the first call to :meth:`_engine.Connection.execute` will close the :class:`_engine.Connection` when that :class:`_engine.CursorResult` has exhausted all result rows. .. 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`. R#N( RBRDRhRlR R3RLRoR(R!R#RRE((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRl+ s#  s1.4sThe :meth:`_engine.Engine.transaction` method is deprecated and will be removed in a future release. Use the :meth:`_engine.Engine.begin` context manager instead.cOs6t|d<|j}|j|||SWdQXdS(sExecute the given function within a transaction boundary. The function is passed a :class:`_engine.Connection` newly procured from :meth:`_engine.Engine.connect` as the first argument, followed by the given \*args and \**kwargs. e.g.:: def do_something(conn, x, y): conn.execute(text("some statement"), {'x':x, 'y':y}) engine.transaction(do_something, 5, 10) The operations inside the function are all invoked within the context of a single :class:`.Transaction`. Upon success, the transaction is committed. If an exception is raised, the transaction is rolled back before propagating the exception. .. note:: The :meth:`.transaction` method is superseded by the usage of the Python ``with:`` statement, which can be used with :meth:`_engine.Engine.begin`:: with engine.begin() as conn: conn.execute(text("some statement"), {'x':5, 'y':10}) .. seealso:: :meth:`_engine.Engine.begin` - engine-level transactional context :meth:`_engine.Connection.transaction` - connection-level version of :meth:`_engine.Engine.transaction` RBN(RRhR(R!RDRR@R((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRY s/ sThe :meth:`_engine.Engine.run_callable` method is deprecated and will be removed in a future release. Use the :meth:`_engine.Engine.begin` context manager instead.cOs6t|d<|j}|j|||SWdQXdS(sGiven a callable object or function, execute it, passing a :class:`_engine.Connection` as the first argument. The given \*args and \**kwargs are passed subsequent to the :class:`_engine.Connection` argument. This function, along with :meth:`_engine.Connection.run_callable`, allows a function to be run with a :class:`_engine.Connection` or :class:`_engine.Engine` object without the need to know which one is being dealt with. RBN(RRhRC(R!RDRR@R((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRC s cKs,|j}|j|||WdQXdS(N(RlRA(R!R>R?R@R((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRA ss:meth:`_engine.Engine.execute`t alternativesAll statement execution in SQLAlchemy 2.0 is performed by the :meth:`_engine.Connection.execute` method of :class:`_engine.Connection`, or in the ORM by the :meth:`.Session.execute` method of :class:`.Session`.cOs%|jdt}|j|||S(sExecutes the given construct and returns a :class:`_engine.CursorResult`. The arguments are the same as those used by :meth:`_engine.Connection.execute`. Here, a :class:`_engine.Connection` is acquired using the :meth:`_engine.Engine.connect` method, and the statement executed with that connection. The returned :class:`_engine.CursorResult` is flagged such that when the :class:`_engine.CursorResult` is exhausted and its underlying cursor is closed, the :class:`_engine.Connection` created here will also be closed, which allows its associated DBAPI connection resource to be returned to the connection pool. R#(RhRR(R!RRRR"((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR ss:meth:`_engine.Engine.scalar`s'All statement execution in SQLAlchemy 2.0 is performed by the :meth:`_engine.Connection.execute` method of :class:`_engine.Connection`, or in the ORM by the :meth:`.Session.execute` method of :class:`.Session`; the :meth:`_future.Result.scalar` method can then be used to return a scalar result.cOs|j|||jS(sExecutes and returns the first column of the first row. The underlying result/cursor is closed after execution. (RR(R!RRR((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR scCs(|jdt}|j||||S(NR#(RhRR(R!RRRRTR"((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR scCs(|jdt}|j||||S(NR#(RhRR(R!RRRRTR"((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR scCs|j|d|S(sReturn a new :class:`_engine.Connection` object. The :class:`_engine.Connection` object is a facade that uses a DBAPI connection internally in order to communicate with the database. This connection is procured from the connection-holding :class:`_pool.Pool` referenced by this :class:`_engine.Engine`. When the :meth:`_engine.Connection.close` method of the :class:`_engine.Connection` object is called, the underlying DBAPI connection is then returned to the connection pool, where it may be used again in a subsequent call to :meth:`_engine.Engine.connect`. R#(RB(R!R#((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRh ssThe :meth:`_engine.Engine.table_names` method is deprecated and will be removed in a future release. Please refer to :meth:`_reflection.Inspector.get_table_names`.cCs8|j|#}tj|}|j|SWdQXdS(sReturn a list of all table names available in the database. :param schema: Optional, retrieve names from a non-default schema. :param connection: Optional, use a specified connection. N(RRtinspecttget_table_names(R!R=R"Rtinsp((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt table_names ssThe :meth:`_engine.Engine.has_table` method is deprecated and will be removed in a future release. Please refer to :meth:`_reflection.Inspector.has_table`.cCs>|jd)}tj|}|j|d|SWdQXdS(s`Return True if the given backend has a table of the given name. .. seealso:: :ref:`metadata_reflection_inspector` - detailed schema inspection using the :class:`_reflection.Inspector` interface. :class:`.quoted_name` - used to pass quoting information along with a schema identifier. R=N(RRRRt has_table(R!t table_nameR=RR((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR scCs}|j}y |SWnb|jjk rx}|dkrNtj|||qytjtj ddtj dnXdS(NiR i( R R(R)RR R<R RR%R(R!RR"R R]((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_wrap_pool_connect( s   cCs|j|jj|S(sCReturn 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` (RRRh(R!Rd((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR6 sN((4RFRGRHRRRRR RBRIRDRR<R'RvRKR R}RxRTRUR@RRt echo_propertyRtRRRR t EMPTY_DICTRt contextlibtcontextmanagerRtobjectRRlRNRRCRARLRRRRRhRRRR(((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyRo sp     L    + .1     tOptionEngineMixincBsYeZeZdZdZdZeeeZdZ dZ ee e Z RS(cCs||_|j|_|j|_|j|_|j|_|j|_|j|_tj|d|j|j j |j |_ |j |_ |j |dS(NRq( t_proxiedRrR RsRtRRRRwRRRRx(R!tproxiedRT((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyR'R s        cCs |jjS(N(RR(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt _get_poolm scCs||j_dS(N(RR(R!R((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt _set_poolp scCs|jjp|jjdtS(NR(RRRGR;R(R!((sI/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/base.pyt_get_has_eventsu scCs||jdsF   @m'B1