Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
ó
‹EYc@€s:ddlmZddlZddlmZmZmZmZddlmZ	ddlm
Z
mZddlmZddl
Z
d	e
fd
„ƒYZdefd„ƒYZd
efd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZde
ejfd„ƒYZdefd„ƒYZdS(iÿÿÿÿ(twith_statementNi(texctutiltlogt
interfaces(Ri(tConnectabletExceptionContext(t_distill_paramst
ConnectioncB€soeZdZd9ed9d9d9d9d„Zd„Zed„ƒZd„Z	d„Z
d„Zd„Zed„ƒZ
ed	„ƒZed
„ƒZd„Zed„ƒZd
„Zed„ƒZed„ƒZed„ƒZd„Zd„Zd9d„Zd„Zd„Zd„Zd9d„Zd„Zed„Zed„Zd„Z d„Z!d„Z"ed„Z#d9d„Z$d „Z%d!„Z&d"„Z'd#„Z(d$„Z)d%„Z*d&„Z+d'„Z,d(„Z-d)„Z.d*„Z/d+„Z0d,„Z1d-„Z2d.„Z3d/„Z4d0„Z5d9d1„Z6d2„Z7eZ8eZ9d3„Z:e;d4„ƒZ<d5„Z=d6„Z>d7„Z?d8„Z@RS(:s:Provides high-level functionality for a wrapped DB-API connection.

    Provides execution support for string-based SQL statements as well as
    :class:`.ClauseElement`, :class:`.Compiled` and :class:`.DefaultGenerator`
    objects. Provides a :meth:`begin` method to return :class:`.Transaction`
    objects.

    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

    cC€sb||_|j|_||_|dk	|_|rr||_||_|j|_t|_	||_
|j|_n¾|dk	r„|n	|jƒ|_d|_
d|_||_	t|_t|_|jjƒ|_|dkrù|j
j|j
ƒ|_
n|p|dko|j|_|s$t‚|j|_|jsE|jjr^|j
j||jƒndS(sÝConstruct a new Connection.

        The constructor here is not public and is only called only by an
        :class:`.Engine`. See :meth:`.Engine.connect` and
        :meth:`.Engine.contextual_connect` methods.

        iN(tenginetdialectt_Connection__branch_fromtNonet_Connection__brancht_Connection__connectiont_execution_optionst_echotFalsetshould_close_with_resulttdispatcht_has_eventstraw_connectiont_Connection__transactiont_Connection__savepoint_seqt_Connection__invalidtTruet_Connection__can_reconnectt_should_log_infot_jointAssertionErrortengine_connect(tselfR	t
connectiontclose_with_resultt_branch_fromRt	_dispatchR((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt__init__/s4						!					
cC€sT|jr|jjƒS|jj|j|jd|d|jd|jd|jƒSdS(sÕReturn a new Connection which references this Connection's
        engine and connection; but does not have close_with_result enabled,
        and also whose close() method does nothing.

        The Core uses this very sparingly, only in the case of
        custom SQL default functions that are to be INSERTed as the
        primary key of a row where we need to get the value back, so we have
        to invoke it distinctly - this is a very uncommon case.

        Userland code accesses _branch() when the connect() or
        contextual_connect() methods are called.  The branched connection
        acts as much as possible like the parent, except that it stays
        connected when a close() event occurs.

        R"RRR#N(Rt_branchR	t_connection_clsRRRR(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR%^s	
				cC€s|jr|jS|SdS(s¯return the 'root' connection.

        Returns 'self' if this connection is not a branch, else
        returns the root connection from which we ultimately branched.

        N(R(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_rootys		cC€s+|jj|jƒ}|jjƒ|_|S(s3Create a shallow copy of this Connection.

        (t	__class__t__new__t__dict__tcopy(Rtc((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_clone‡scC€s|S(N((R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt	__enter__scC€s|jƒdS(N(tclose(Rttypetvaluet	traceback((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt__exit__’scK€sc|jƒ}|jj|ƒ|_|js6|jjrL|jj||ƒn|jj||ƒ|S(s$ Set non-SQL options for the connection which take effect
        during execution.

        The method returns a copy of this :class:`.Connection` which references
        the same underlying DBAPI connection, but also defines the given
        execution options which will take effect for a call to
        :meth:`execute`. As the new :class:`.Connection` references the same
        underlying resource, it's usually a good idea to ensure that the copies
        will be discarded immediately, which is implicit if used as in::

            result = connection.execution_options(stream_results=True).\
                                execute(stmt)

        Note that any key/value can be passed to
        :meth:`.Connection.execution_options`, and it will be stored in the
        ``_execution_options`` dictionary of the :class:`.Connection`.   It
        is suitable for usage by end-user schemes to communicate with
        event listeners, for example.

        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:`.Connection`.

        :param autocommit: Available on: Connection, statement.
          When True, a COMMIT will be invoked after execution
          when executed in 'autocommit' mode, i.e. when an explicit
          transaction is not begun on the connection. Note that DBAPI
          connections by default are always in a transaction - SQLAlchemy uses
          rules applied to different kinds of statements to determine if
          COMMIT will be invoked in order to provide its "autocommit" feature.
          Typically, all INSERT/UPDATE/DELETE statements as well as
          CREATE/DROP statements have autocommit behavior enabled; SELECT
          constructs do not. Use this option when invoking a SELECT or other
          specific SQL construct where COMMIT is desired (typically when
          calling stored procedures and such), and an explicit
          transaction is not in progress.

        :param compiled_cache: Available on: Connection.
          A dictionary where :class:`.Compiled` objects
          will be cached when the :class:`.Connection` compiles a clause
          expression into a :class:`.Compiled` object.
          It is the user's responsibility to
          manage the size of this dictionary, which will have keys
          corresponding to the dialect, clause element, the column
          names within the VALUES or SET clause of an INSERT or UPDATE,
          as well as the "batch" mode for an INSERT or UPDATE statement.
          The format of this dictionary is not guaranteed to stay the
          same in future releases.

          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 isolation_level: Available on: :class:`.Connection`.
          Set the transaction isolation level for
          the lifespan of this :class:`.Connection` object (*not* the
          underyling DBAPI connection, for which the level is reset
          to its original setting upon termination of this
          :class:`.Connection` object).

          Valid values include
          those string values accepted by the
          :paramref:`.create_engine.isolation_level`
          parameter passed to :func:`.create_engine`.  These levels are
          semi-database specific; see individual dialect documentation for
          valid levels.

          Note that this option necessarily affects the underlying
          DBAPI connection for the lifespan of the originating
          :class:`.Connection`, and is not per-execution. This
          setting is not removed until the underlying DBAPI connection
          is returned to the connection pool, i.e.
          the :meth:`.Connection.close` method is called.

          .. warning::  The ``isolation_level`` execution option should
             **not** be used when a transaction is already established, that
             is, the :meth:`.Connection.begin` method or similar has been
             called.  A database cannot change the isolation level on a
             transaction in progress, and different DBAPIs and/or
             SQLAlchemy dialects may implicitly roll back or commit
             the transaction, or not affect the connection at all.

             .. versionchanged:: 0.9.9 A warning is emitted when the
                ``isolation_level`` execution option is used after a
                transaction has been started with :meth:`.Connection.begin`
                or similar.

          .. note:: The ``isolation_level`` execution option is implicitly
             reset if the :class:`.Connection` is invalidated, e.g. via
             the :meth:`.Connection.invalidate` method, or if a
             disconnection error occurs.  The new connection produced after
             the invalidation will not have the isolation level re-applied
             to it automatically.

          .. seealso::

                :paramref:`.create_engine.isolation_level`
                - set per :class:`.Engine` isolation level

                :meth:`.Connection.get_isolation_level` - view current level

                :ref:`SQLite Transaction Isolation <sqlite_isolation_level>`

                :ref:`Postgresql Transaction Isolation <postgresql_isolation_level>`

                :ref:`MySQL Transaction Isolation <mysql_isolation_level>`

                :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.

          .. versionadded:: 0.7.6

        :param stream_results: Available on: Connection, statement.
          Indicate to the dialect that results should be
          "streamed" and not pre-buffered, if possible.  This is a limitation
          of many DBAPIs.  The flag is currently understood only by the
          psycopg2 dialect.

        (R-RtunionRR	Rt set_connection_execution_optionsR
(RtoptR,((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pytexecution_options•s„cC€sd|jko|jS(s)Return True if this connection is closed.R(R*R(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pytclosed scC€s
|jjS(s/Return True if this connection was invalidated.(R'R(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pytinvalidated'scC€s`y|jSWnNtk
r[y|jƒSWq\tk
rW}|j|ddddƒq\XnXdS(sƒThe underlying DB-API connection managed by this Connection.

        .. seealso::


            :ref:`dbapi_connections`

        N(RtAttributeErrort_revalidate_connectiont	Exceptiont_handle_dbapi_exceptionR(Rte((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR -s
cC€sJy|jj|jƒSWn,tk
rE}|j|ddddƒnXdS(sReturn the current isolation level assigned to this
        :class:`.Connection`.

        This will typically be the default isolation level as determined
        by the dialect, unless if the
        :paramref:`.Connection.execution_options.isolation_level`
        feature has been used to alter the isolation level on a
        per-:class:`.Connection` basis.

        This attribute will typically perform a live SQL operation 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.  Compare to the
        :attr:`.Connection.default_isolation_level` accessor
        which returns the dialect-level setting without performing a SQL
        query.

        .. versionadded:: 0.9.9

        .. seealso::

            :attr:`.Connection.default_isolation_level` - view default level

            :paramref:`.create_engine.isolation_level`
            - set per :class:`.Engine` isolation level

            :paramref:`.Connection.execution_options.isolation_level`
            - set per :class:`.Connection` isolation level

        N(R
tget_isolation_levelR R<R=R(RR>((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR?@scC€s
|jjS(säThe default isolation level assigned to this :class:`.Connection`.

        This is the isolation level setting that the :class:`.Connection`
        has when first procured via the :meth:`.Engine.connect` method.
        This level stays in place until the
        :paramref:`.Connection.execution_options.isolation_level` is used
        to change the setting on a per-:class:`.Connection` basis.

        Unlike :meth:`.Connection.get_isolation_level`, this attribute is set
        ahead of time from the first connection procured by the dialect,
        so SQL query is not invoked when this accessor is called.

        .. versionadded:: 0.9.9

        .. seealso::

            :meth:`.Connection.get_isolation_level` - view current level

            :paramref:`.create_engine.isolation_level`
            - set per :class:`.Engine` isolation level

            :paramref:`.Connection.execution_options.isolation_level`
            - set per :class:`.Connection` isolation level

        (R
tdefault_isolation_level(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR@dscC€s„|jr|jjƒS|jrq|jrq|jdk	rItjdƒ‚n|jj	d|ƒ|_
t|_|j
Stjdƒ‚dS(Ns8Can't reconnect until invalid transaction is rolled backt_connectionsThis Connection is closed(
RR;RRRRRtInvalidRequestErrorR	RRRtResourceClosedError(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR;s	
	cC€st|jdtƒS(Ntis_valid(tgetattrRR(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_connection_is_validŽscC€s'|jo&|jo&t|jdtƒS(NRD(R8R9RERR(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt#_still_open_and_connection_is_valid–s

cC€s
|jjS(sInfo dictionary associated with the underlying DBAPI connection
        referred to by this :class:`.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:`.Connection`.

        (R tinfo(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRHscC€s
|jƒS(siReturns a branched version of this :class:`.Connection`.

        The :meth:`.Connection.close` method on the returned
        :class:`.Connection` can be called and this
        :class:`.Connection` will remain open.

        This method provides usage symmetry with
        :meth:`.Engine.connect`, including for usage
        with context managers.

        (R%(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pytconnect«s
cK€s
|jƒS(stReturns a branched version of this :class:`.Connection`.

        The :meth:`.Connection.close` method on the returned
        :class:`.Connection` can be called and this
        :class:`.Connection` will remain open.

        This method provides usage symmetry with
        :meth:`.Engine.contextual_connect`, including for usage
        with context managers.

        (R%(Rtkwargs((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pytcontextual_connectºs
cC€sc|jr
dS|jr(tjdƒ‚n|jjrJ|jjj|ƒn|j`t|j_	dS(s­Invalidate the underlying DBAPI connection associated with
        this :class:`.Connection`.

        The underlying DBAPI connection is literally closed (if
        possible), and is discarded.  Its source connection pool will
        typically lazily create a new connection to replace it.

        Upon the next use (where "use" typically means using the
        :meth:`.Connection.execute` method or similar),
        this :class:`.Connection` will attempt to
        procure a new DBAPI connection using the services of the
        :class:`.Pool` as a source of connectivty (e.g. a "reconnection").

        If a transaction was in progress (e.g. the
        :meth:`.Connection.begin` method has been called) when
        :meth:`.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:`.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:`.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:`.Connection.invalidate` method, just like auto-invalidation,
        will at the connection pool level invoke the
        :meth:`.PoolEvents.invalidate` event.

        .. seealso::

            :ref:`pool_connection_invalidation`

        NsThis Connection is closed(
R9R8RRCR'RFRt
invalidateRR(Rt	exception((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRLÉs'			cC€s|jjƒdS(sDetach the underlying DB-API connection from its connection pool.

        E.g.::

            with engine.connect() as conn:
                conn.detach()
                conn.execute("SET search_path TO schema1, schema2")

                # work with connection

            # connection is fully closed (since we used "with:", can
            # also call .close())

        This :class:`.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((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRNûscC€sO|jr|jjƒS|jdkr;t|ƒ|_|jSt||jƒ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.

        Nested calls to :meth:`.begin` on the same :class:`.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.

        See also:

        :meth:`.Connection.begin_nested` - use a SAVEPOINT

        :meth:`.Connection.begin_twophase` - use a two phase /XID transaction

        :meth:`.Engine.begin` - context manager available from
        :class:`.Engine`.

        N(RtbeginRRtRootTransactiontTransaction(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyROs"	
cC€sS|jr|jjƒS|jdkr7t|ƒ|_nt||jƒ|_|jS(sBegin a nested transaction and return a transaction handle.

        The returned object is an instance of :class:`.NestedTransaction`.

        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.

        See also :meth:`.Connection.begin`,
        :meth:`.Connection.begin_twophase`.
        N(Rtbegin_nestedRRRPtNestedTransaction(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRRAs	
cC€sw|jr|jjd|ƒS|jdk	r=tjdƒ‚n|dkr^|jjjƒ}nt	||ƒ|_|jS(sBegin 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.

        See also :meth:`.Connection.begin`,
        :meth:`.Connection.begin_twophase`.

        txidsOCannot start a two phase transaction when a transaction is already in progress.N(
Rtbegin_twophaseRRRRBR	R
t
create_xidtTwoPhaseTransaction(RRT((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRUXs	cC€s|jjj|ƒS(N(R	R
tdo_recover_twophase(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pytrecover_twophaseuscC€s |jjj||d|ƒdS(Ntrecover(R	R
tdo_rollback_twophase(RRTRZ((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pytrollback_preparedxscC€s |jjj||d|ƒdS(NRZ(R	R
tdo_commit_twophase(RRTRZ((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pytcommit_prepared{scC€s|jjdk	S(s,Return True if a transaction is in progress.N(R'RR(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pytin_transaction~scC€sÅ|jst‚|jr/|jjjdƒn|jsD|jjrW|jj|ƒny;|jj	j
|jƒ|jjdkr‘||j_nWn,tk
rÀ}|j|ddddƒnXdS(NsBEGIN (implicit)(RRRR	tloggerRHRRROR
tdo_beginR t_reset_agentRR<R=(RttransactionR>((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_begin_impl‚s	cC€sø|jst‚|js%|jjr8|jj|ƒn|jrë|jr`|jjj	dƒnzMy|jj
j|jƒWn,t
k
r«}|j|ddddƒnXWd|jrÞ|jj|jkrÞd|j_nd|_Xn	d|_dS(NtROLLBACK(RRRR	RtrollbackRGRR`RHR
tdo_rollbackR R<R=RRRbR(RR>((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_rollback_impl’s 		!

cC€sã|jst‚|js%|jjr8|jj|ƒn|jrW|jjjdƒnzMy|jj	j
|jƒWn,tk
r¢}|j
|ddddƒnXWd|jrÕ|jj|jkrÕd|j_nd|_XdS(NtCOMMIT(RRRR	RtcommitRR`RHR
t	do_commitR R<R=RRRbR(Rt
autocommitR>((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_commit_impl§s	!
cC€s|jst‚|js%|jjr;|jj||ƒn|dkrf|jd7_d|j}n|jr‰|jj	j
||ƒ|SdS(Nissa_savepoint_%s(RRRR	Rt	savepointRRRGR
tdo_savepoint(Rtname((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_savepoint_impl¹s	cC€sm|jst‚|js%|jjr>|jj|||ƒn|jr`|jjj||ƒn||_	dS(N(
RRRR	Rtrollback_savepointRGR
tdo_rollback_to_savepointR(RRptcontext((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_rollback_to_savepoint_implÆs	cC€sm|jst‚|js%|jjr>|jj|||ƒn|jr`|jjj||ƒn||_	dS(N(
RRRR	Rtrelease_savepointRGR
tdo_release_savepointR(RRpRt((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_release_savepoint_implÐs	cC€s§|jst‚|jr/|jjjdƒn|jsD|jjr]|jj||j	ƒn|j
r£|jjj||j	ƒ|j
jdkr£||j
_q£ndS(NsBEGIN TWOPHASE (implicit)(RRRR	R`RHRRRURTRGR
tdo_begin_twophaseR RbR(RRc((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_begin_twophase_implÚs		cC€sy|jst‚|js%|jjr;|jj||ƒn|jrut|jt	ƒs\t‚|jj
j||ƒndS(N(RRRR	Rtprepare_twophaseRGt
isinstanceRRWR
tdo_prepare_twophase(RRT((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_prepare_twophase_implès	cC€s½|jst‚|js%|jjr>|jj|||ƒn|jr°t|jt	ƒs_t‚z|jj
j|||ƒWd|jj
|jkr£d|j_
nd|_Xn	d|_dS(N(RRRR	Rtrollback_twophaseRGR|RRWR
R[R RbR(RRTtis_prepared((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_rollback_twophase_implòs	
cC€s½|jst‚|js%|jjr>|jj|||ƒn|jr°t|jt	ƒs_t‚z|jj
j|||ƒWd|jj
|jkr£d|j_
nd|_Xn	d|_dS(N(RRRR	Rtcommit_twophaseRGR|RRWR
R]R RbR(RRTR€((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_commit_twophase_impls	
cC€s#|jjƒs|jjƒndS(N(R'R_Rh(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt
_autorollbackscC€s°|jr?z"y
|`Wntk
r)nXWdt|_dSXny
|j}Wntk
r_n;X|jƒ|j|jkrˆd|_n|j	sš|`nt|_d|_dS(s8Close this :class:`.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` referenced
        by the :class:`.Engine` that produced this
        :class:`.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:`.Connection`.

        After :meth:`~.Connection.close` is called, the
        :class:`.Connection` is permanently in a closed state,
        and will allow no further operations.

        N(
RRR:RRR/RbRRR(Rtconn((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR/s&	

	


			cO€s|j|||ŽjƒS(sExecutes and returns the first column of the first row.

        The underlying result/cursor is closed after execution.
        (texecutetscalar(Rtobjecttmultiparamstparams((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR‡FscO€swt|tjdƒr)|j|||ƒSy
|j}Wn*tk
rbtjdt|ƒƒ‚nX||||ƒSdS(sExecutes a SQL statement construct and returns a
        :class:`.ResultProxy`.

        :param object: The statement to be executed.  May be
         one of:

         * a plain string
         * any :class:`.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

        :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 <http://www.python.org/dev/peps/pep-0249/>`_
         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.

        isUnexecutable object type: %sN(	R|Rtstring_typest
_execute_textt_execute_on_connectionR:RRBR0(RRˆR‰RŠtmeth((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR†Ns;

cC€s|j|jƒ||ƒS(s%Execute a sql.FunctionElement object.(t_execute_clauseelementtselect(RtfuncR‰RŠ((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_execute_function”sc
C€s.|js|jjrMx5|jjD]$}|||||ƒ\}}}q"WnyRy
|j}Wntk
r||jƒ}nX|j}|jj	|||ƒ}Wn,t
k
rÍ}|j|ddddƒnX|j
|dƒ}	|jrö|jƒn|js|jjr*|jj|||||	ƒn|	S(s&Execute a schema.ColumnDefault object.N(RR	Rtbefore_executeRR:R;R
texecution_ctx_clst
_init_defaultR<R=Rt
_exec_defaultRR/t
after_execute(
RtdefaultR‰RŠtfnR…R
tctxR>tret((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_execute_defaultšs(%

			
cC€sÁ|js|jjrMx5|jjD]$}|||||ƒ\}}}q"Wn|j}|jd|ƒ}|j||jj|d|ƒ}|jsž|jjr½|jj
|||||ƒn|S(sExecute a schema.DDL object.R
N(RR	RR“R
tcompilet_execute_contextR”t	_init_ddlRR—(RtddlR‰RŠR™R
tcompiledR›((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_execute_ddl¸s%			c	C€s¦|js|jjrMx5|jjD]$}|||||ƒ\}}}q"Wnt||ƒ}|ru|djƒ}ng}|j}d|jkr ||tt	|ƒƒt
|ƒdkf}|jdj|ƒ}	|	dkrJ|j
d|d|dt
|ƒdkƒ}	|	|jd|<qJn*|j
d|d|dt
|ƒdkƒ}	|j||jj|	||	|ƒ}
|jsƒ|jjr¢|jj|||||
ƒn|
S(s#Execute a sql.ClauseElement object.itcompiled_cacheiR
tcolumn_keystinlineN(RR	RR“RtkeysR
RttupletsortedtlentgetRRRžR”t_init_compiledR—(RtelemR‰RŠR™tdistilled_paramsR¦R
tkeytcompiled_sqlR›((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRÏs:%	*			cC€sÁ|js|jjrMx5|jjD]$}|||||ƒ\}}}q"Wn|j}t||ƒ}|j||jj||||ƒ}|jsž|jjr½|jj	|||||ƒn|S(sExecute a sql.Compiled object.(
RR	RR“R
RRžR”R«R—(RR¡R‰RŠR™R
t
parametersR›((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_execute_compiledùs%		cC€sÁ|js|jjrMx5|jjD]$}|||||ƒ\}}}q"Wn|j}t||ƒ}|j||jj||||ƒ}|jsž|jjr½|jj	|||||ƒn|S(sExecute a string SQL statement.(
RR	RR“R
RRžR”t_init_statementR—(Rt	statementR‰RŠR™R
R°R›((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRŒs%		c

G€sáyFy
|j}Wntk
r/|jƒ}nX|||||Œ}Wn5tk
r}}|j|tj|ƒ|ddƒnX|jr”|j	ƒn|j
|j|j}	}}|j
sÇ|d}n|jsÜ|jjrx;|jjD]*}
|
||	||||j
ƒ\}}qéWn|jr^|jjj|ƒ|jjjdtj|ddƒƒnt}y[|j
rÝ|jjr¸x9|jjjD]%}
|
|	|||ƒrŒt}PqŒqŒWn|s¾|jj|	|||ƒq¾ná|rT|jrT|jjr2x6|jjjD]"}
|
|	||ƒr	t}Pq	q	Wn|s¾|jj|	||ƒq¾nj|jjrœx9|jjjD]%}
|
|	|||ƒrpt}PqpqpWn|s¾|jj|	|||ƒnWn,tk
rí}|j||||	|ƒnX|js|jjr(|jj||	||||j
ƒn|jr>|jƒn|j sP|j!r_|j"ƒ}n.|j#ƒ}|j$dkr|j%dtƒn|j&r¾|j'j(dkr¾|j'j)dtƒn|j*rÝ|j+rÝ|j,ƒn|S(s\Create an :class:`.ExecutionContext` and execute, returning
        a :class:`.ResultProxy`.is%rtbatchesi
t_autoclose_connectionRlN(-RR:R;R<R=Rt	text_typeRR¡tpre_exectcursorR³R°texecutemanyRR	Rtbefore_cursor_executeRR`RHtsql_utilt_repr_paramsRR
tdo_executemanyRt
no_parameterstdo_execute_no_paramst
do_executetafter_cursor_executet	post_exectis_crudtis_textt_setup_crud_result_proxytget_result_proxyt	_metadatat_soft_closetshould_autocommitR'RRmt_soft_closedRR/(
RR
tconstructorR³R°targsR…RtR>R¸R™tevt_handledtresult((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRž%s°

	
	
			
	
	
	

c	C€sQ|js|jjrPx8|jjD]'}||||||tƒ\}}q"Wn|jr…|jjj|ƒ|jjjd|ƒnybx[|jjsdn|jjj	D]}|||||ƒrªPqªqªW|jj	||||ƒWn,t
k
r}|j|||||ƒnX|js+|jjrM|jj|||||tƒndS(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%rN((
RR	RRºRRR`RHR
RÀR<R=RÁ(RR¸R³R°RtR™R>((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_cursor_execute•s>		cC€sBy|jƒWn-tk
r=|jjjjddtƒnXdS(s\Close the given cursor, catching exceptions
        and turning into log warnings.

        sError closing cursortexc_infoN(R/R<R	tpoolR`terrorR(RR¸((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_safe_close_cursorÄs

cC€s‰tjƒ}|r-|jdkr-||_n|jst||jjjƒo|j	o|jj
||jsv|jnd|ƒ|_|r|j|_
qnt
}|jrætjtjj||||jjjd|jƒ|ƒnt
|_z#t||jjjƒp|dk	o|dk}|ratjj||||jjjd|jd|jƒ}	nd}	d}
|js‚|jjrŠ|jjdtƒrŠ|rÆ|rÆ|jj||||||ƒnt||	|j||||||jƒ	}x]|jjD]O}y,||ƒ}
|
dk	r.|
|_}
nWqýtk
rK}|}
PqýXqýW|	r~|j|j
kr~|j
|	_|_n|j }n|r¦|r¦|j!|ƒn|jsÒ|rÅ|j"|ƒn|j#ƒn|
rëtj|
|ƒn&|rtj|	|ƒn
tj$|ŒWd|`|jrn|`|jsn|j}|r[|jj%j&||ƒn|j'|ƒqnn|j(r„|j)ƒnXdS(NR
tconnection_invalidatedtskip_user_error_events(*tsysRÐRMRt_is_disconnectR|R
tdbapitErrorR8t
is_disconnectR9RRt_reentrant_errorRtraise_from_causeRt
DBAPIErrortinstanceRR	RRªRRtdbapi_errortExceptionContextImplthandle_errortchained_exceptionR<RÔtinvalidate_pool_on_disconnectthandle_dbapi_exceptionRÓR„treraiseRÑt_invalidateRLRR/(RR>R³R°R¸RtRÐRãtshould_wraptsqlalchemy_exceptiontnewraiseRšR™tper_fnt_raisedtdbapi_conn_wrapper((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR=Ós¨	
			
				

			

				c

C€smtjƒ}|j|ddƒ}t||jjƒ}|rftjj	dd||jjd|ƒ}nd}d}|j
r*t|||ddddd|ƒ	}	x]|jj
D]O}
y,|
|	ƒ}|dk	rÝ||	_}nWq¬tk
rú}|}Pq¬Xq¬W|r*||	jkr*|	j|_}q*n|rCtj||ƒn&|r\tj||ƒn
tj|ŒdS(NRÔ(RÖRÐRÚRR|RØRÙRRÝRÞRRàRRáRâR<RÔRRÜRå(
tclsR>R
R	RÐRÚRçRèRéRšR™RêRë((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt$_handle_dbapi_exception_noconnectionNsD			
cC€s|jjj|ƒS(N(R	R
tget_default_schema_name(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pytdefault_schema_name‚scO€s^|jƒ}y'|j|||Ž}|jƒ|SWn$tjƒ|jƒWdQXnXdS(s5Execute the given function within a transaction boundary.

        The function is passed this :class:`.Connection`
        as the first argument, followed by the given \*args and \**kwargs,
        e.g.::

            def do_something(conn, x, y):
                conn.execute("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:`.Connection.begin`::

               with conn.begin():
                   conn.execute("some statement", {'x':5, 'y':10})

           As well as with :meth:`.Engine.begin`::

               with engine.begin() as conn:
                   conn.execute("some statement", {'x':5, 'y':10})

        See also:

            :meth:`.Engine.begin` - engine-level transactional
            context

            :meth:`.Engine.transaction` - engine-level version of
            :meth:`.Connection.transaction`

        N(ROtrun_callableRjRtsafe_reraiseRf(Rt	callable_RÌRJttransR›((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRc…s*

cO€s||||ŽS(sÈGiven a callable object or function, execute it, passing
        a :class:`.Connection` as the first argument.

        The given \*args and \**kwargs are passed subsequent
        to the :class:`.Connection` argument.

        This function, along with :meth:`.Engine.run_callable`,
        allows a function to be run with a :class:`.Connection`
        or :class:`.Engine` object without the need to know
        which one is being dealt with.

        ((RRóRÌRJ((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRñ¸s
cK€s ||j||j|ƒdS(N(R
ttraverse_single(RtvisitorcallabletelementRJ((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_run_visitorÇsN(At__name__t
__module__t__doc__RRR$R%tpropertyR'R-R.R3R7R8R9R R?R@R;RFRGRHRIRKRLRNRORRRURYR\R^R_RdRhRmRqRuRxRzR~RRƒR„R/R‡R†R’RœR¢RR±RŒRžRÏRÓRÛR×R=tclassmethodRîRðRcRñRø(((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRs|,					‹	$	
		2		+					
	
	
		
				-		F				*			p/		{4		3	RàcB€seZdZd„ZRS(s3Implement the :class:`.ExceptionContext` interface.c

C€sL||_||_||_||_||_||_||_|	|_dS(N(R	R Rètoriginal_exceptiontexecution_contextR³R°RÚ(
RRMRèR	R R¸R³R°RtRÚ((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR$Ïs							(RùRúRûR$(((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRàÌsRQcB€seeZdZd„Zed„ƒZd„Zd„Zd„Zd„Z	d„Z
d„Zd	„ZRS(
s)Represent a database transaction in progress.

    The :class:`.Transaction` object is procured by
    calling the :meth:`~.Connection.begin` method of
    :class:`.Connection`::

        from sqlalchemy import create_engine
        engine = create_engine("postgresql://scott:tiger@localhost/test")
        connection = engine.connect()
        trans = connection.begin()
        connection.execute("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:`.Connection.begin` method::

        with connection.begin():
            connection.execute("insert into x (a, b) values (1, 2)")

    The Transaction object is **not** threadsafe.

    See also:  :meth:`.Connection.begin`, :meth:`.Connection.begin_twophase`,
    :meth:`.Connection.begin_nested`.

    .. index::
      single: thread safety; Transaction
    cC€s||_||_t|_dS(N(R t_actual_parentRt	is_active(RR tparent((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR$üs		cC€s
|jp|S(N(R(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_parentscC€s0|jjsdS|j|kr,|jƒndS(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(RRRf(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR/scC€s'|jjsdS|jƒt|_dS(s/Roll back this :class:`.Transaction`.

        N(RRt_do_rollbackR(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRfs
cC€s|jjƒdS(N(RRf(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRscC€s5|jjstjdƒ‚n|jƒt|_dS(s"Commit this :class:`.Transaction`.sThis transaction is inactiveN(RRRRBt
_do_commitR(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRj!s
cC€sdS(N((R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR)scC€s|S(N((R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR.,scC€s[|dkrM|jrMy|jƒWqWtjƒ|jƒWdQXqWXn
|jƒdS(N(RRRjRRòRf(RR0R1R2((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR3/s
(
RùRúRûR$RüRR/RfRRjRR.R3(((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRQÜs								RPcB€s#eZd„Zd„Zd„ZRS(cC€s-tt|ƒj|dƒ|jj|ƒdS(N(tsuperRPR$RR Rd(RR ((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR$;scC€s|jr|jjƒndS(N(RR Rh(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR?s	cC€s|jr|jjƒndS(N(RR Rm(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRCs	(RùRúR$RR(((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRP:s		RScB€s)eZdZd„Zd„Zd„ZRS(sëRepresent a 'nested', or SAVEPOINT transaction.

    A new :class:`.NestedTransaction` object may be procured
    using the :meth:`.Connection.begin_nested` method.

    The interface is the same as that of :class:`.Transaction`.

    cC€s/tt|ƒj||ƒ|jjƒ|_dS(N(RRSR$R Rqt
_savepoint(RR R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR$RscC€s)|jr%|jj|j|jƒndS(N(RR RuRR(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRVs		cC€s)|jr%|jj|j|jƒndS(N(RR RxRR(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR[s		(RùRúRûR$RR(((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRSHs		RWcB€s2eZdZd„Zd„Zd„Zd„ZRS(sRepresent a two-phase transaction.

    A new :class:`.TwoPhaseTransaction` object may be procured
    using the :meth:`.Connection.begin_twophase` method.

    The interface is the same as that of :class:`.Transaction`
    with the addition of the :meth:`prepare` method.

    cC€s?tt|ƒj|dƒt|_||_|jj|ƒdS(N(	RRWR$RRt_is_preparedRTR Rz(RR RT((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR$ls		cC€s>|jjstjdƒ‚n|jj|jƒt|_dS(sqPrepare this :class:`.TwoPhaseTransaction`.

        After a PREPARE, the transaction can be committed.

        sThis transaction is inactiveN(	RRRRBR R~RTRR(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pytpreparerscC€s|jj|j|jƒdS(N(R RRTR(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR}scC€s|jj|j|jƒdS(N(R RƒRTR(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR€s(RùRúRûR$R	RR(((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRWas
				tEnginecB€sVeZdZejƒZeZeZ	ddddd„Zd„Zd„Z
ed„ƒZed„ƒZejƒZd„Zd„Zd„Zejdd	„ƒZdd
„Zdefd„ƒYZed
„Zd„Zd„Zd„Z d„Z!ddd„Z"d„Z#d„Z$ed„Z%ddd„Z&dd„Z'd„Z(dd„Z)RS(sp
    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` object is instantiated publicly using the
    :func:`~sqlalchemy.create_engine` function.

    See also:

    :doc:`/core/engines`

    :ref:`connections_toplevel`

    cC€s”||_||_||_||j_|r9||_n||_||_tj|d|ƒ|rzt	j
j||ƒn|r|j|ndS(Ntechoflag(
RÑturlR
t_dialecttlogging_nametechoR	Rtinstance_loggerRtConnectionProxyt_adapt_listenertupdate_execution_options(RRÑR
RRRtproxyR7((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR$™s					cK€s?|jj|ƒ|_|jj||ƒ|jj||ƒdS(sæUpdate the default execution_options dictionary
        of this :class:`.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:`.create_engine`.

        .. seealso::

            :meth:`.Connection.execution_options`

            :meth:`.Engine.execution_options`

        N(RR4Rtset_engine_execution_optionsR
(RR6((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR«scK€s
t||ƒS(s¸Return a new :class:`.Engine` that will provide
        :class:`.Connection` objects with the given execution options.

        The returned :class:`.Engine` remains related to the original
        :class:`.Engine` in that it shares the same connection pool and
        other state:

        * The :class:`.Pool` used by the new :class:`.Engine` is the
          same instance.  The :meth:`.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`
          inherits the events of the parent, and new events can be associated
          with the new :class:`.Engine` individually.
        * The logging configuration and logging_name is copied from the parent
          :class:`.Engine`.

        The intent of the :meth:`.Engine.execution_options` method is
        to implement "sharding" schemes where multiple :class:`.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:`.Connection` objects that will contain the execution option
        ``shard_id=shard1``, and ``shard2`` will produce :class:`.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:`.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

        .. versionadded:: 0.8

        .. seealso::

            :meth:`.Connection.execution_options` - update execution options
            on a :class:`.Connection` object.

            :meth:`.Engine.update_execution_options` - update the execution
            options for a given :class:`.Engine` in place.

        (tOptionEngine(RR6((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR7ÁsAcC€s
|jjS(siString name of the :class:`~sqlalchemy.engine.interfaces.Dialect`
        in use by this :class:`Engine`.(R
Rp(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRpscC€s
|jjS(siDriver name of the :class:`~sqlalchemy.engine.interfaces.Dialect`
        in use by this :class:`Engine`.(R
tdriver(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRscC€sd|jS(Ns
Engine(%r)(R(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt__repr__scC€s3|jjƒ|jjƒ|_|jj|ƒdS(sµDispose of the connection pool used by this :class:`.Engine`.

        This 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`, so when they are closed individually,
        eventually the :class:`.Pool` which they are associated with will
        be garbage collected and they will be closed out fully, if
        not already closed on checkin.

        A new connection pool is created immediately after the old one has
        been disposed.   This new pool, like all SQLAlchemy connection pools,
        does not make any actual connections to the database until one is
        first requested, so as long as the :class:`.Engine` isn't used again,
        no new connections will be made.

        .. seealso::

            :ref:`engine_disposal`

        N(RÑtdisposetrecreateRtengine_disposed(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRs
cC€s,|jƒ}|j|diƒSWdQXdS(N((RKRœ(RR˜R…((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRœ1scc€s2|dkr)|jƒ}|VWdQXn|VdS(N(RRK(RR R…((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_optional_conn_ctx_manager5scK€s/|j|ƒ}|j|||WdQXdS(N(RRø(RRöR÷R RJR…((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRø=st
_trans_ctxcB€s#eZd„Zd„Zd„ZRS(cC€s||_||_||_dS(N(R…RcR!(RR…RcR!((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR$Cs		cC€s|jS(N(R…(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR.HscC€sF|dk	r|jjƒn
|jjƒ|jsB|jjƒndS(N(RRcRfRjR!R…R/(RR0R1R2((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR3Ks

	(RùRúR$R.R3(((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRBs		cC€s\|jd|ƒ}y|jƒ}Wn$tjƒ|jƒWdQXnXtj|||ƒS(s»Return a context manager delivering a :class:`.Connection`
        with a :class:`.Transaction` established.

        E.g.::

            with engine.begin() as conn:
                conn.execute("insert into table (x, y, z) values (1, 2, 3)")
                conn.execute("my_special_procedure(5)")

        Upon successful operation, the :class:`.Transaction`
        is committed.  If an error is raised, the :class:`.Transaction`
        is rolled back.

        The ``close_with_result`` flag is normally ``False``, and indicates
        that the :class:`.Connection` will be closed when the operation
        is complete.   When set to ``True``, it indicates the
        :class:`.Connection` is in "single use" mode, where the
        :class:`.ResultProxy` returned by the first call to
        :meth:`.Connection.execute` will close the :class:`.Connection` when
        that :class:`.ResultProxy` has exhausted all result rows.

        .. versionadded:: 0.7.6

        See also:

        :meth:`.Engine.connect` - procure a :class:`.Connection` from
        an :class:`.Engine`.

        :meth:`.Connection.begin` - start a :class:`.Transaction`
        for a particular :class:`.Connection`.

        R!N(RKRORRòR/R
R(RR!R…Rô((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyROSs!
cO€s,|jƒ}|j|||ŽSWdQXdS(sÚExecute the given function within a transaction boundary.

        The function is passed a :class:`.Connection` newly procured
        from :meth:`.Engine.contextual_connect` as the first argument,
        followed by the given \*args and \**kwargs.

        e.g.::

            def do_something(conn, x, y):
                conn.execute("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.begin`::

               with engine.begin() as conn:
                   conn.execute("some statement", {'x':5, 'y':10})

        See also:

            :meth:`.Engine.begin` - engine-level transactional
            context

            :meth:`.Connection.transaction` - connection-level version of
            :meth:`.Engine.transaction`

        N(RKRc(RRóRÌRJR…((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRc|s'cO€s,|jƒ}|j|||ŽSWdQXdS(sÌGiven a callable object or function, execute it, passing
        a :class:`.Connection` as the first argument.

        The given \*args and \**kwargs are passed subsequent
        to the :class:`.Connection` argument.

        This function, along with :meth:`.Connection.run_callable`,
        allows a function to be run with a :class:`.Connection`
        or :class:`.Engine` object without the need to know
        which one is being dealt with.

        N(RKRñ(RRóRÌRJR…((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRñ¦s
cO€s%|jdtƒ}|j|||ŽS(sExecutes the given construct and returns a :class:`.ResultProxy`.

        The arguments are the same as those used by
        :meth:`.Connection.execute`.

        Here, a :class:`.Connection` is acquired using the
        :meth:`~.Engine.contextual_connect` method, and the statement executed
        with that connection. The returned :class:`.ResultProxy` is flagged
        such that when the :class:`.ResultProxy` is exhausted and its
        underlying cursor is closed, the :class:`.Connection` created here
        will also be closed, which allows its associated DBAPI connection
        resource to be returned to the connection pool.

        R!(RKRR†(RR³R‰RŠR ((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR†¶scO€s|j|||ŽjƒS(N(R†R‡(RR³R‰RŠ((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR‡ÉscC€s%|jdtƒ}|j|||ƒS(NR!(RKRR(RR¬R‰RŠR ((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRÌscC€s%|jdtƒ}|j|||ƒS(NR!(RKRR±(RR¡R‰RŠR ((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR±ÐscK€s|j||S(sOReturn a new :class:`.Connection` object.

        The :class:`.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`
        referenced by this :class:`.Engine`. When the
        :meth:`~.Connection.close` method of the :class:`.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.connect`.

        (R&(RRJ((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRIÔscK€s+|j||j|jjdƒd||S(s¡Return a :class:`.Connection` object which may be part of some
        ongoing context.

        By default, this method does the same thing as :meth:`.Engine.connect`.
        Subclasses of :class:`.Engine` may override this method
        to provide contextual behavior.

        :param close_with_result: When True, the first :class:`.ResultProxy`
          created by the :class:`.Connection` will call the
          :meth:`.Connection.close` method of that connection as soon as any
          pending result rows are exhausted. This is used to supply the
          "connectionless execution" behavior provided by the
          :meth:`.Engine.execute` method.

        R!N(R&t_wrap_pool_connectRÑRIR(RR!RJ((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRKäs
cC€sD|j|ƒ/}|s'|jj}n|jj||ƒ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. Default is
          the ``contextual_connect`` for this ``Engine``.
        N(RR
Rðtget_table_names(RtschemaR R…((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyttable_namesûs	cC€s|j|jj||ƒS(sUReturn True if the given backend has a table of the given name.

        .. seealso::

            :ref:`metadata_reflection_inspector` - detailed schema inspection
            using the :class:`.Inspector` interface.

            :class:`.quoted_name` - used to pass quoting information along
            with a schema identifier.

        (RñR
t	has_table(Rt
table_nameR ((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR"	scC€si|j}y|ƒSWnN|jjk
rd}|dkrNtj|||ƒqetjtj	ƒŒnXdS(N(
R
RØRÙRRRîRRåRÖRÐ(RR™R R
R>((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyRs	cC€s|j|jj|ƒS(s&Return 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:`.Connection`
        is not needed.   When a :class:`.Connection` object is already
        present, the DBAPI connection is available using
        the :attr:`.Connection.connection` accessor.

        .. seealso::

            :ref:`dbapi_connections`

        (RRÑtunique_connection(RRA((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR"sN(*RùRúRûRt
immutabledictRRRRR&RR$RR7RüRpRRt
echo_propertyRRRRœt
contextlibtcontextmanagerRRøRˆRRORcRñR†R‡RR±RIRKR!R"RR(((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR
„s>			C			)	*						RcB€sSeZd„Zd„Zd„ZeeeƒZd„Zd„ZeeeƒZ	RS(cC€s„||_|j|_|j|_|j|_|j|_tj|d|jƒ|jj|jƒ|_|j	|_	|j
|dS(NR(t_proxiedRR
RRRRRRRR(RtproxiedR7((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR$<s	cC€s
|jjS(N(R)RÑ(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt	_get_poolGscC€s||j_dS(N(R)RÑ(RRÑ((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt	_set_poolJscC€s|jjp|jjdtƒS(NR(R)RR*RªR(R((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_get_has_eventsOscC€s||jd<dS(NR(R*(RR1((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt_set_has_eventsSs(
RùRúR$R+R,RüRÑR-R.R(((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyR;s					(t
__future__RRÖtRRRRtsqlR»RRRR'RRàRˆRQRPRSRWt
IdentifiedR
R(((sK/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/engine/base.pyt<module>s("ÿÿÿÿÿ»^#ÿ¸