[Jc@s'dZddddddddd d d d d ddddddgZddkZddkZddklZlZlZlZl Z ddk l Z de fdYZ d e fdYZde fdYZde fdYZdefdYZde fdYZd efdYZd efdYZdefd YZd efd!YZd"Zde fd#YZdefd$YZd e fd%YZdefd&YZdefd'YZdeifd(YZdeifd)YZd*Z dS(+sBasic components for SQL execution and interfacing with DB-API. Defines the basic components used to interface DB-API modules with higher-level statement-construction, connection-management, execution and result contexts. tBufferedColumnResultProxytBufferedColumnRowtBufferedRowResultProxytCompiledt Connectablet Connectiont DefaultRunnertDialecttEnginetExecutionContexttNestedTransactiont ResultProxytRootTransactiontRowProxytSchemaIteratortStringIOt TransactiontTwoPhaseTransactiontconnection_memoizeiN(texctschematutilttypestlog(t expressioncBseZdZdZdZdZddZddZddZ dZ dZ d Z d Z d Zd Zd ZdZdZdZeedZeedZdZddZddZdZRS(sC Define the behavior of a specific database and DB-API combination. Any aspect of metadata definition, SQL query generation, execution, result-set handling, or anything else which varies between databases is defined under the general category of the Dialect. The Dialect acts as a factory for other database-specific object implementations including ExecutionContext, Compiled, DefaultGenerator, and TypeEngine. All Dialects implement the following attributes: name identifying name for the dialect (i.e. 'sqlite') positional True if the paramstyle for this Dialect is positional. paramstyle the paramstyle to be used (some DB-APIs support multiple paramstyles). convert_unicode True if Unicode conversion should be applied to all ``str`` types. encoding type of encoding to use for unicode, usually defaults to 'utf-8'. schemagenerator a :class:`~sqlalchemy.schema.SchemaVisitor` class which generates schemas. schemadropper a :class:`~sqlalchemy.schema.SchemaVisitor` class which drops schemas. defaultrunner a :class:`~sqlalchemy.schema.SchemaVisitor` class which executes defaults. statement_compiler a :class:`~sqlalchemy.engine.base.Compiled` class used to compile SQL statements preparer a :class:`~sqlalchemy.sql.compiler.IdentifierPreparer` class used to quote identifiers. supports_alter ``True`` if the database supports ``ALTER TABLE``. max_identifier_length The maximum length of identifier names. supports_unicode_statements Indicate whether the DB-API can receive SQL statements as Python unicode strings supports_sane_rowcount Indicate whether the dialect properly implements rowcount for ``UPDATE`` and ``DELETE`` statements. supports_sane_multi_rowcount Indicate whether the dialect properly implements rowcount for ``UPDATE`` and ``DELETE`` statements when executed via executemany. preexecute_pk_sequences Indicate if the dialect should pre-execute sequences on primary key columns during an INSERT, if it's desired that the new row's primary key be available after execution. supports_pk_autoincrement Indicates if the dialect should allow the database to passively assign a primary key column value. dbapi_type_map A mapping of DB-API type objects present in this Dialect's DB-API implmentation mapped to TypeEngine implementations used by the dialect. This is used to apply types to result sets based on the DB-API types present in cursor.description; it only takes effect for result sets against textual statements where no explicit typemap was present. supports_default_values Indicates if the construct ``INSERT INTO tablename DEFAULT VALUES`` is supported description_encoding type of encoding to use for unicode when working with metadata descriptions. If set to ``None`` no encoding will be done. This usually defaults to 'utf-8'. cCs tdS(sBuild DB-API compatible connection arguments. Given a :class:`~sqlalchemy.engine.url.URL` object, returns a tuple consisting of a `*args`/`**kwargs` suitable to send directly to the dbapi's connect function. N(tNotImplementedError(tselfturl((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytcreate_connect_argsuscCs tdS(sFTransform a generic type to a database-specific type. Transforms the given :class:`~sqlalchemy.types.TypeEngine` instance from generic to database-specific. Subclasses will usually use the :func:`~sqlalchemy.types.adapt_type` method in the types module to make this job easy. N(R(Rttypeobj((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyttype_descriptors cCs tdS(s0Return a tuple of the database's version number.N(R(Rt connection((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytserver_version_infoscCs tdS(sPLoad table description from the database. Given a :class:`~sqlalchemy.engine.Connection` and a :class:`~sqlalchemy.schema.Table` object, reflect its columns and properties from the database. If include_columns (a list or set) is specified, limit the autoload to the given column names. N(R(RRttabletinclude_columns((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt reflecttables cCs tdS(s&Check the existence of a particular table in the database. Given a :class:`~sqlalchemy.engine.Connection` object and a string `table_name`, return True if the given table (possibly within the specified `schema`) exists in the database, False otherwise. N(R(RRt table_nameR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt has_tables cCs tdS(sCheck the existence of a particular sequence in the database. Given a :class:`~sqlalchemy.engine.Connection` object and a string `sequence_name`, return True if the given sequence exists in the database, False otherwise. N(R(RRt sequence_nameR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt has_sequencescCs tdS(sgReturn the string name of the currently selected schema given a :class:`~sqlalchemy.engine.Connection`.N(R(RR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytget_default_schema_namescCs tdS(sMProvide an implementation of *connection.begin()*, given a DB-API connection.N(R(RR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytdo_beginscCs tdS(sPProvide an implementation of *connection.rollback()*, given a DB-API connection.N(R(RR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt do_rollbackscCs tdS(sCreate a two-phase transaction ID. This id will be passed to do_begin_twophase(), do_rollback_twophase(), do_commit_twophase(). Its format is unspecified. N(R(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt create_xidscCs tdS(sNProvide an implementation of *connection.commit()*, given a DB-API connection.N(R(RR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt do_commitscCs tdS(sBCreate a savepoint with the given name on a SQLAlchemy connection.N(R(RRtname((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt do_savepointscCs tdS(s9Rollback a SQL Alchemy connection to the named savepoint.N(R(RRR-((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytdo_rollback_to_savepointscCs tdS(s8Release the named savepoint on a SQL Alchemy connection.N(R(RRR-((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytdo_release_savepointscCs tdS(s6Begin a two phase transaction on the given connection.N(R(RRtxid((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytdo_begin_twophasescCs tdS(s8Prepare a two phase transaction on the given connection.N(R(RRR1((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytdo_prepare_twophasescCs tdS(s9Rollback a two phase transaction on the given connection.N(R(RRR1t is_preparedtrecover((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytdo_rollback_twophasescCs tdS(s7Commit a two phase transaction on the given connection.N(R(RRR1R4R5((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytdo_commit_twophasescCs tdS(s^Recover list of uncommited prepared two phase transaction identifiers on the given connection.N(R(RR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytdo_recover_twophasescCs tdS(sIProvide an implementation of *cursor.executemany(statement, parameters)*.N(R(Rtcursort statementt parameterstcontext((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytdo_executemanyscCs tdS(sEProvide an implementation of *cursor.execute(statement, parameters)*.N(R(RR9R:R;R<((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt do_executescCs tdS(sEReturn True if the given DB-API error indicates an invalid connectionN(R(Rte((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt is_disconnectsN(t__name__t __module__t__doc__RRR tNoneR#R%R'R(R)R*R+R,R.R/R0R2R3tTruetFalseR6R7R8R=R>R@(((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs.[              cBsheZdZdZdZdZdZdZdZdZ dZ d Z d Z RS( sA messenger object for a Dialect that corresponds to a single execution. ExecutionContext should have these datamembers: connection Connection object which can be freely used by default value generators to execute SQL. This Connection should reference the same underlying connection/transactional resources of root_connection. root_connection Connection object which is the source of this ExecutionContext. This Connection may have close_with_result=True set, in which case it can only be used once. dialect dialect which created this ExecutionContext. cursor DB-API cursor procured from the connection, compiled if passed to constructor, sqlalchemy.engine.base.Compiled object being executed, statement string version of the statement to be executed. Is either passed to the constructor, or must be created from the sql.Compiled object by the time pre_exec() has completed. parameters bind parameters passed to the execute() method. For compiled statements, this is a dictionary or list of dictionaries. For textual statements, it should be in a format suitable for the dialect's paramstyle (i.e. dict or list of dicts for non positional, list or list of lists/tuples for positional). isinsert True if the statement is an INSERT. isupdate True if the statement is an UPDATE. should_autocommit True if the statement is a "committable" statement postfetch_cols a list of Column objects for which a server-side default or inline SQL expression value was fired off. applies to inserts and updates. cCs tdS(sReturn a new cursor generated from this ExecutionContext's connection. Some dialects may wish to change the behavior of connection.cursor(), such as postgres which may return a PG "server side" cursor. N(R(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt create_cursor@scCs tdS(sCalled before an execution of a compiled statement. If a compiled statement was passed to this ExecutionContext, the `statement` and `parameters` datamembers must be initialized after this statement is complete. N(R(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytpre_execJscCs tdS(sCalled after the execution of a compiled statement. If a compiled statement was passed to this ExecutionContext, the `last_insert_ids`, `last_inserted_params`, etc. datamembers should be available after this method completes. N(R(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt post_execTscCs tdS(sgReturn a result object corresponding to this ExecutionContext. Returns a ResultProxy. N(R(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytresult^scCs tdS(sHReceive a DBAPI exception which occured upon execute, result fetch, etc.N(R(RR?((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pythandle_dbapi_exceptionfscCs tdS(s[Parse the given textual statement and return True if it refers to a "committable" statementN(R(RR:((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytshould_autocommit_textkscCs tdS(sSReturn the list of the primary key values for the last insert statement executed. This does not apply to straight textual clauses; only to ``sql.Insert`` objects compiled against a ``schema.Table`` object. The order of items in the list is the same as that of the Table's 'primary_key' attribute. N(R(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytlast_inserted_idsps cCs tdS(sReturn a dictionary of the full parameter dictionary for the last compiled INSERT statement. Includes any ColumnDefaults or Sequences that were pre-executed. N(R(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytlast_inserted_params{scCs tdS(sReturn a dictionary of the full parameter dictionary for the last compiled UPDATE statement. Includes any ColumnDefaults that were pre-executed. N(R(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytlast_updated_paramsscCs tdS(sjReturn True if the last INSERT or UPDATE row contained inlined or database-side defaults. N(R(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytlastrow_has_defaultss( RARBRCRGRHRIRJRKRLRMRNRORP(((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR s4     cBsbeZdZd d dZdZdZeiddZ dZ dZ dZ RS( sRepresent a compiled SQL expression. The ``__str__`` method of the ``Compiled`` object should produce the actual text of the statement. ``Compiled`` objects are specific to their underlying database dialect, and also may or may not be specific to the columns referenced within a particular set of bind parameters. In no case should the ``Compiled`` object be dependent on the actual values of those bind parameters, even though it may reference those values as defaults. cCs4||_||_||_||_|i|_dS(s~Construct a new ``Compiled`` object. dialect ``Dialect`` to compile against. statement ``ClauseElement`` to be compiled. column_keys a list of column names to be compiled into an INSERT or UPDATE statement. bind Optional Engine or Connection to compile this statement against. N(tdialectR:t column_keystbindtsupports_executiont can_execute(RRQR:RRRS((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt__init__s     cCs tdS(s;Produce the internal string representation of this element.N(R(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytcompilescCs tdS(s6Return the string text of the generated SQL statement.N(R(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt__str__ssADeprecated. Use construct_params(). (supports Unicode key names.)cKs |i|S(N(tconstruct_params(Rtparams((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt get_paramsscCs tdS(sReturn the bind params for this compiled object. `params` is a dict of string/object pairs whos values will override bind values compiled in to the statement. N(R(RRZ((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRYscOs<|i}|djotidn|i|||S(sExecute this compiled object.s>This Compiled object is not bound to any Engine or Connection.N(RSRDRtUnboundExecutionErrort_execute_compiled(Rt multiparamsRZR?((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytexecutes  cOs|i||iS(sBExecute this compiled object and return the result's scalar value.(R_tscalar(RR^RZ((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR`sN( RARBRCRDRVRWRXRt deprecatedR[RYR_R`(((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs    cBsAeZdZdZdZdZdZdddZRS(sInterface for an object which supports execution of SQL constructs. The two implementations of ``Connectable`` are :class:`Connection` and :class:`Engine`. cCs tdS(sCReturn a Connection object which may be part of an ongoing context.N(R(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytcontextual_connectscKs tdS(s;Create a table or index given an appropriate schema object.N(R(Rtentitytkwargs((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytcreatescKs tdS(s9Drop a table or index given an appropriate schema object.N(R(RRcRd((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytdropscOs tdS(N(R(RtobjectR^RZ((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR_scCs tdS(N(R(RtelemR^RZ((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt_execute_clauseelementsN( RARBRCRbReRfR_RDRi(((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs     cBsZeZdZd4eedZdZedZedZ edZ edZ edZ edZ d Zd Zd4d Zd Zd ZdZd4dZdZedZedZdZdZdZdZd4dZdZdZdZdZ dZ!dZ"dZ#dZ$d Z%d!Z&d"Z'd#Z(d$Z)d%Z*d&Z+d'Z,d(Z-d)Z.d*Z/d+Z0d,Z1d4d-Z2d4d.Z3he)e4i56e+e4i66e,e76e*e8i96e/e8i:6e-e;6Z<d/Z=d0Z>d4d1Z?d2Z@d3ZARS(5stProvides high-level functionality for a wrapped DB-API connection. Provides execution support for string-based SQL statements as well as ClauseElement, Compiled and DefaultGenerator objects. Provides a begin method to return Transaction objects. The Connection object is **not** thread-safe. .. index:: single: thread safety; Connection cCsP||_|p |i|_d|_||_d|_||_t|_ dS(sConstruct a new Connection. Connection objects are typically constructed by an :class:`~sqlalchemy.engine.Engine`, see the ``connect()`` and ``contextual_connect()`` methods of Engine. iN( tenginetraw_connectiont_Connection__connectionRDt_Connection__transactiont_Connection__close_with_resultt_Connection__savepoint_seqt_Connection__branchRFt_Connection__invalid(RRjRtclose_with_resultt_branch((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRVs     cCs|ii|i|idtS(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. This is used to execute "sub" statements within a single execution, usually an INSERT statement. Rs(RjRRlRE(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRss cCs |iiS(s Dialect used by this Connection.(RjRQ(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRQ%scCs|i o d|ijS(s)return True if this connection is closed.Rl(Rqt__dict__(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytclosed+scCs|iS(s/return True if this connection was invalidated.(Rq(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt invalidated1scCsy |iSWnrtj of|ioF|idj otidn|ii|_t |_|iStidnXdS(s<The underlying DB-API connection managed by this Connection.s8Can't reconnect until invalid transaction is rolled backsThis Connection is closedN( RltAttributeErrorRqRmRDRtInvalidRequestErrorRjRkRF(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR7s   cCs|iS(sIndicates if this Connection should be closed when a corresponding ResultProxy is closed; this is essentially an auto-release mode. (Rn(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytshould_close_with_resultFscCs |iiS(s:A collection of per-DB-API connection instance properties.(Rtinfo(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRzNscCs|S(sReturns self. This ``Connectable`` interface method returns self, allowing Connections to be used interchangably with Engines in most situations that require a bind. ((R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytconnectSscKs|S(sReturns self. This ``Connectable`` interface method returns self, allowing Connections to be used interchangably with Engines in most situations that require a bind. ((RRd((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRb]scCsQ|iotidn|iio|ii|n|`t|_dS(sInvalidate the underlying DBAPI connection associated with this Connection. The underlying DB-API 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 usage, this Connection will attempt to reconnect to the pool with a new connection. Transactions in progress remain in an "opened" state (even though the actual transaction is gone); these must be explicitly rolled back before a reconnect on this Connection can proceed. This is to prevent applications from accidentally continuing their transactional operations in a non-transactional state. sThis Connection is closedN(RuRRxRltis_validt invalidateRERq(Rt exception((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR}gs   cCs|iidS(sDetach the underlying DB-API connection from its connection pool. This Connection instance will remain useable. When closed, the DB-API connection will be literally closed and not returned to its pool. The pool will typically lazily create a new connection to replace the detached connection. 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). Also see :class:`~sqlalchemy.interfaces.PoolListener` for a mechanism to modify connection state when connections leave and return to their connection pool. N(Rltdetach(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRscCs:|idjot||_nt||iS|iS(swBegin a transaction and return a Transaction handle. Repeated calls to ``begin`` on the same Connection will create a lightweight, emulated nested transaction. Only the outermost transaction may ``commit``. Calls to ``commit`` on inner transactions are ignored. Any transaction in the hierarchy may ``rollback``, however. N(RmRDR R(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytbegins cCs?|idjot||_nt||i|_|iS(sqBegin a nested transaction and return a Transaction handle. 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. N(RmRDR R (R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt begin_nesteds cCs_|idj otidn|djo|iii}nt|||_|iS(sBegin a two-phase or XA transaction and return a Transaction handle. xid the two phase transaction id. If not supplied, a random id will be generated. sOCannot start a two phase transaction when a transaction is already in progress.N(RmRDRRxRjRQR+R(RR1((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytbegin_twophases  cCs|iii|S(N(RjRQR8(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytrecover_twophasescCs |iii||d|dS(NR5(RjRQR6(RR1R5((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytrollback_preparedscCs |iii||d|dS(NR5(RjRQR7(RR1R5((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytcommit_preparedscCs |idj S(s,Return True if a transaction is in progress.N(RmRD(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytin_transactionscCsv|iio|iiidny|iii|iWn1tj o%}|i|ddddnXdS(NtBEGIN( Rjt_should_log_infotloggerRzRQR)Rt Exceptiont_handle_dbapi_exceptionRD(RR?((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt _begin_impls cCs|i o|i o|iio|iio|iiidny#|iii |i d|_ Wqt j o%}|i|ddddqXn d|_ dS(NtROLLBACK(RuRvRlR|RjRRRzRQR*RRDRmRR(RR?((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt_rollback_impls#   cCs|iio|iiidny#|iii|id|_Wn1t j o%}|i |ddddnXdS(NtCOMMIT( RjRRRzRQR,RRDRmRR(RR?((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt _commit_impls  cCsY|djo |id7_d|i}n|iio|iii|||SdS(Nissa_savepoint_%s(RDRoRlR|RjRQR.(RR-((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt_savepoint_impls   cCs4|iio|iii||n||_dS(N(RlR|RjRQR/Rm(RR-R<((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt_rollback_to_savepoint_impls cCs4|iio|iii||n||_dS(N(RlR|RjRQR0Rm(RR-R<((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt_release_savepoint_impls cCs+|iio|iii||ndS(N(RlR|RjRQR2(RR1((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt_begin_twophase_impls cCsE|iio4t|itpt|iii||ndS(N( RlR|t isinstanceRmRtAssertionErrorRjRQR3(RR1((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt_prepare_twophase_impls cCsQ|iio7t|itpt|iii|||nd|_dS(N( RlR|RRmRRRjRQR6RD(RR1R4((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt_rollback_twophase_impl s cCsQ|iio7t|itpt|iii|||nd|_dS(N( RlR|RRmRRRjRQR7RD(RR1R4((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt_commit_twophase_impls cCs|ip|indS(N(RR(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt _autorollbacks cCsOy |i}Wntj odSX|ip|int|_|`dS(sClose this Connection.N(RlRwRptcloseRFRq(Rtconn((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs   cOs|i|||iS(sExecutes and returns the first column of the first row. The underlying result/cursor is closed after execution. (R_R`(RRgR^RZ((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR`(scKs|ii|i|d||S(NRS(RQtstatement_compiler(RR:Rd((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR0scOshxat|iD]1}|tijoti|||||SqWtidtt|dS(s#Executes and returns a ResultProxy.sUnexecutable object type: N(ttypet__mro__Rt executorsRRxtstr(RRgR^RZtc((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR_3s cCs|p|o|gSgSnt|djor|d}t|ttfo,| pt|ddo|S|gSqt|do|gS|ggSn!t|ddo|S|gSdS(s given arguments from the calling form *multiparams, **params, return a list of bind parameter structures, usually a list of dictionaries. in the case of 'raw' execution which accepts positional parameters, it may be a list of tuples or lists.iit__iter__tkeysN(tlenRtlistttuplethasattr(RR^RZtzero((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt__distill_params<s   cCs|i|i||S(N(Ritselect(RtfuncR^RZ((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt_execute_functionYscCs"|iii|ii|S(N(RjRQt defaultrunnert%_Connection__create_execution_contextttraverse_single(RtdefaultR^RZ((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt_execute_default\sc Cs|i||}|o|di}ng}|id|id|id|dt|djd|}|i|S(NitcompiledRQRRtinlineiR;(t_Connection__distill_paramsRRRWRQRt_Connection__execute_context(RRhR^RZRR<((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRi_s - cCs1|id|d|i||}|i|S(sExecute a sql.Compiled object.RR;(RRR(RRR^RZR<((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR]ls cCs7|i||}|id|d|}|i|S(NR:R;(RRR(RR:R^RZR;R<((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt _execute_textuscCs|io|in|io&|i|i|i|id|n'|i|i|i|idd||io|in|i o|i o|i n|i S(NR<i( RRHt executemanyt_cursor_executemanyR9R:R;t_cursor_executeRItshould_autocommitRRtget_result_proxy(RR<((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt__execute_contextzs  && cCs<|o|d|d}}nd}|d||||S(Nii(RD(RtddlRZR^t schema_item((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt _execute_ddlsc Cs t|dtotiidd|nt|_zt||i i i pdS|o|i |n|i i |}|o|i||iin8|o|in|i|io|intii|||d|Wd|`XdS(Nt_reentrant_errortconnection_invalidated(tgetattrRFRt DBAPIErrortinstanceRDRERRRQtdbapitErrorRKR@R}RjtdisposeRRRn(RR?R:R;R9R<R@((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs&    "cKsvy&|ii}|i|d||SWnItj o=}|i||idd|iddddnXdS(NRR:R;(RjRQtexecution_ctx_clsRRtgetRD(RRdRQR?((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt__create_execution_contexts  1c Cs|iio0|iii||iiit|ny |ii|||d|Wn1tj o%}|i|||||nXdS(NR<( RjRRRztreprRQR>RR(RR9R:R;R<R?((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs  c Cs|iio0|iii||iiit|ny |ii|||d|Wn1tj o%}|i|||||nXdS(NR<( RjRRRzRRQR=RR(RR9R:R;R<R?((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs  cKs|ii|d||S(s;Create a Table or Index given an appropriate Schema object.R(RjRe(RRcRd((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRescKs|ii|d||S(s9Drop a Table or Index given an appropriate Schema object.R(RjRf(RRcRd((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRfscCs|ii|||S(sEReflect the columns in the given string table name from the database.(RjR#(RR!R"((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR#scCs|iii|S(N(RjRQR((R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytdefault_schema_namescCs ||S(N((Rt callable_((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt run_callablesN(BRARBRCRDRFRVRstpropertyRQRuRvRRyRzR{RbR}RRRRRRRRRRRRRRRRRRRRR`RR_RRRRiR]RRRRRRRRtFunctiont ClauseElementRRt SchemaItemtDDLt basestringRReRfR#RR(((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRsx                                       cBsVeZdZdZdZdZdZdZdZdZ dZ RS( sRepresent a Transaction in progress. The Transaction object is **not** threadsafe. .. index:: single: thread safety; Transaction cCs&||_|p||_t|_dS(N(Rt_parentREt is_active(RRtparent((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRVs cCs4|iipdS|i|jo|indS(s0Close this 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(RRtrollback(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs cCs)|iipdSt|_|idS(N(RRRFt _do_rollback(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs  cCs|iidS(N(RR(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRscCs7|iiptidn|it|_dS(NsThis transaction is inactive(RRRRxt _do_commitRF(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytcommit s  cCsdS(N((R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRscCs|S(N((R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt __enter__scCs3|djo|io|in |idS(N(RDRRR(RRtvaluet traceback((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt__exit__s( RARBRCRVRRRRRRR(((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs       cBs#eZdZdZdZRS(cCs*tt|i|d|iidS(N(tsuperR RVRDRR(RR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRVscCs|iidS(N(RR(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR scCs|iidS(N(RR(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR#s(RARBRVRR(((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR s  cBs#eZdZdZdZRS(cCs/tt|i|||ii|_dS(N(RR RVRRt _savepoint(RRR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRV'scCs|ii|i|idS(N(RRRR(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR+scCs|ii|i|idS(N(RRRR(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR.s(RARBRVRR(((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR &s  cBs,eZdZdZdZdZRS(cCsBtt|i|dt|_||_|ii|idS(N( RRRVRDRFt _is_preparedR1RR(RRR1((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRV2s  cCs@|iiptidn|ii|it|_dS(NsThis transaction is inactive( RRRRxRRR1RER(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytprepare8s cCs|ii|i|idS(N(RRR1R(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR>scCs|ii|i|idS(N(RRR1R(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRAs(RARBRVRRR(((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR1s   cBs"eZdZdddZedZeiZ dZ dZ ddZ ddZ dZedZd Zdd Zdd Zdd Zd ZdZdddZdZdZdZedZdddZdddZddZdZRS(s Connects a :class:`~sqlalchemy.pool.Pool` and :class:`~sqlalchemy.engine.base.Dialect` together to provide a source of database connectivity and behavior. cCso||_||_||_||_||_ti|d||_|ott ||_ n t |_ dS(Ntechoflag( tpoolRRQtechoRjRtinstance_loggerRt_proxy_connection_clsR(RRRQRRtproxy((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRVKs     cCs |iiS(sQString name of the :class:`~sqlalchemy.engine.Dialect` in use by this ``Engine``.(RQR-(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR-WscCsdt|iS(Ns Engine(%s)(RR(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt__repr___scCs#|ii|ii|_dS(N(RRtrecreate(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRbs cKs#|i|ii|d||dS(s]Create a table or index within this engine's database connection given a schema.Table object.RN(t _run_visitorRQtschemagenerator(RRcRRd((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRefscKs#|i|ii|d||dS(s[Drop a table or index within this engine's database connection given a schema.Table object.RN(RRQt schemadropper(RRcRRd((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRfkscCs5|i}z|i|dhSWd|iXdS(N((RbRR(RRR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRps cCstid|S(NRS(Rt_FunctionGenerator(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRwscOsti|d|||S(s:Return a sql.text() object for performing literal queries.RS(Rttext(RRtargsRd((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR{scKsl|djo|idt}n|}z ||i||i|Wd|djo|inXdS(NRr(RDRbRFRQttraverseR(RtvisitorcallabletelementRRdR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs   c Os|djo|i}n|}zK|i}y$||||}|i|SWn|inXWd|djo|inXdS(sSExecute the given function within a transaction boundary. This is a shortcut for explicitly calling `begin()` and `commit()` and optionally `rollback()` when exceptions are raised. The given `*args` and `**kwargs` will be passed to the function, as well as the Connection used in the transaction. N(RDRbRRRR(RRRRRdRttranstret((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt transactions      cOsZ|djo|i}n|}z||||SWd|djo|inXdS(N(RDRbR(RRRRRdR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs  cOs%|idt}|i|||S(NRr(RbRER_(RR:R^RZR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR_scOs|i|||iS(N(R_R`(RR:R^RZ((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR`scCs%|idt}|i|||S(NRr(RbRERi(RRhR^RZR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRiscCs%|idt}|i|||S(NRr(RbRER](RRR^RZR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR]scKs|ii|i|d||S(NRS(RQR(RR:Rd((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRscKs|i||S(s+Return a newly allocated Connection object.(R(RRd((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR{scKs"|i||iid||S(sReturn a Connection object which may be newly allocated, or may be part of some ongoing context. This Connection is meant to be used by the various "auto-connecting" operations. Rr(RRR{(RRrRd((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRbsc Cs|djo|i}n|}|p0y|ii|}WqZtj oqZXnz|ii||SWd|djo|inXdS(sReturn a list of all table names available in the database. schema: Optional, retrieve names from a non-default schema. connection: Optional, use a specified connection. Default is the ``contextual_connect`` for this ``Engine``. N(RDRbRQR(Rt table_namesR(RRRR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs   cCs`|djo|i}n|}z|ii|||Wd|djo|inXdS(sLGiven a Table object, reflects its columns and properties from the database.N(RDRbRQR#R(RR!RR"R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR#s  csifdS(Ncsii|dS(R(RQR%(R(R$RR(s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyts(R(RR$R((RR$Rs:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR%scCs |iiS(sReturn a DB-API connection.(Rtunique_connection(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRksN( RARBRCRDRVRR-Rt echo_propertyRRRReRfRRRRRRR_R`RiR]RR{RFRbRR#R%Rk(((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRDs2                cs#d|ffdYS(NtProxyConnectioncs\eZfdZddfdZdfdZdfdZRS(cs%i|t|i|||S(N(R_R(RRgR^RZ(RR(s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR_scs3i|t|i||pg|phS(N(R_R(RRhR^RZ(RR(s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRiscs(it|i||||tS(N(tcursor_executeRRRF(RR9R:R;R<(RR(s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRscs(it|i||||tS(N(RRRRE(RR9R:R;R<(RR(s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR sN(RARBR_RDRiRR((RR(s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs((tclsR((RRs:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs cBseZdZddgZdZdZdZdZdZdZ dZ d Z d Z d Zd Zd ZdZdZdZdZdZRS(sProxy a single cursor row for a parent ResultProxy. Mostly follows "ordered dictionary" behavior, mapping result values to the string-based column name, the integer position of the result in the row, as well as Column instances which can be mapped to the original Columns that produced this result set (for results that correspond to constructed SQL expressions). t__parentt__rowcCsJ||_||_|iio'|iiiiidt|ndS(s8RowProxy objects are constructed by ResultProxy objects.sRow N(t_RowProxy__parentt_RowProxy__rowt_echoR<RjRtdebugR(RRtrow((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRVs   cCs|iidS(sClose the parent ResultProxy.N(RR(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR"scCs|ii|i|S(N(Rt_has_keyR(Rtkey((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt __contains__'scCs t|iS(N(RR(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt__len__*sccs;x4tt|iD]}|ii|i|VqWdS(N(txrangeRRRt_get_col(Rti((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR-scs<|jp/|tfdttiDjS(Nc3s+x$|]}iii|VqWdS(N(RR R(t.0R(R(s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pys 5s (RR RR(Rtother((Rs:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt__eq__3s cCs|i| S(N(R(RR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt__ne__8scCstt|S(N(RR(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR;scCs|ii|i|S(s4Return True if this RowProxy contains the given key.(RRR(RR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pythas_key>scCs|ii|i|S(N(RR R(RR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt __getitem__CscCsIy|ii|i|SWn(tj o}t|idnXdS(Ni(RR RtKeyErrorRwR(RR-R?((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt __getattr__FscCs4g}|iD]}||t||fq~S(s@Return a list of tuples, each tuple containing a key/value pair.(titerkeysR(Rt_[1]R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytitemsLscCs |iiS(s@Return the list of keys as strings represented by this RowProxy.(RR(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRQscCst|iiS(N(titerRR(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRVscCs t|S(s9Return the values represented by this RowProxy as a list.(R(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytvaluesYscCs t|S(N(R(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt itervalues^sN(RARBRCt __slots__RVRR R RRDt__hash__RRRRRRRRRRR(((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR s&                cBseZdZRS(cCsYg}tt|D]}|ti|||q~}tt|i||dS(N(R RR R RRRV(RRRRR ((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRVbs<(RARBRV(((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRascBseZdZeZdZedZedZedZ dZ dZ dZ dZ d Zd Zd Zd Zd ZdZdZdZdZdZdZdZddZdZdZddZdZdZ RS(sWraps a DB-API cursor object to provide easier access to row columns. Individual columns may be accessed by their integer position, case-insensitive column name, or by ``schema.Column`` object. e.g.:: row = fetchone() col1 = row[0] # access via integer position col2 = row['col2'] # access via name col3 = row[mytable.c.mycol] # access via Column object. ResultProxy also contains a map of TypeEngine objects and will invoke the appropriate ``result_processor()`` method before returning columns, as well as the ExecutionContext corresponding to the statement execution. It provides several methods for which to obtain information from the underlying ExecutionContext. cCsS||_|i|_t|_|i|_|i|_|ii|_ |i dS(sJResultProxy objects are constructed via the execute() method on SQLEngine.N( R<RQRFRuR9troot_connectionRRjRRt_init_metadata(RR<((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRVs     cCs)|idjo|iiS|iSdS(N(t _rowcountRDR<t get_rowcount(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytrowcountscCs |iiS(N(R9t lastrowid(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR#scCs |iiS(N(R<tout_parameters(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR$sc Cs|ii}|djo!|ii|_|idSd|_tid|_ |i |i _ g|_ |i i}x t|D]\}}|d}|i io|i|i i}nd|jo|}|idd}nd}|iiody#|ii|i\}}} Wqtj o.|d|i|dti}}} qXn(|d|i|dti}}} | | i|i i|i |f} |i i|i| | j o)| |i|df|i |is ($R9t descriptionRDR<R!R RRtpopulate_column_dictt_propst_ResultProxy__key_fallbacktcreatorRRQtdbapi_type_mapt enumeratetdescription_encodingtdecodetsplitt result_maptlowerRRRtNULLTYPEt dialect_impltresult_processort setdefaultt!_ResultProxy__ambiguous_processortappendRRjRRRR( RtmetadatattypemapR titemtcolnametorignameR-tobjttype_trecto((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRsP           #0''")"-  cs|ifd}|S(Ncst|to&|i}|jo |Snt|tion|io(|iijo|iiSt|do(|iijo|iiSnti dt |dS(NR-s.Could not locate column in row for column '%s'( RRR2Rt ColumnElementt_labelRR-RtNoSuchColumnErrorR(R(tprops(s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytfallbacks    &(R)(RRF((REs:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt__key_fallbacks csfd}|S(NcstiddS(NsVAmbiguous column name '%s' in result set! try 'use_labels' option on select statement.(RRx(R(R<(s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytprocesss ((RR<RH((R<s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt__ambiguous_processorscCsF|ip8t|_|ii|iio|iiqBndS(sClose this ResultProxy. Closes the underlying DBAPI cursor corresponding to the execution. If this ResultProxy was generated from an implicit execution, the underlying Connection will also be closed (returns the underlying DBAPI connection to the connection pool.) This method is called automatically when: * all result rows are exhausted using the fetchXXX() methods. * cursor.description is None. N(RuRER9RRRy(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs     cCs.y|i|tSWntj otSXdS(N(R)RERRF(RRR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs  ccs;x4to,|i}|djo tq|VqWdS(N(REtfetchoneRDt StopIteration(RR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR s    cCs |iiS(syReturn ``last_inserted_ids()`` from the underlying ExecutionContext. See ExecutionContext for details. (R<RM(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRMscCs |iiS(s{Return ``last_updated_params()`` from the underlying ExecutionContext. See ExecutionContext for details. (R<RO(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyROscCs |iiS(s|Return ``last_inserted_params()`` from the underlying ExecutionContext. See ExecutionContext for details. (R<RN(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRN"scCs |iiS(sReturn ``lastrow_has_defaults()`` from the underlying ExecutionContext. See ExecutionContext for details. (R<RP(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRP*scCs |iiS(s~Return ``postfetch_cols()`` from the underlying ExecutionContext. See ExecutionContext for details. (R<tpostfetch_cols(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRL2scCs |iiS(N(R<t prefetch_cols(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRM:scCs |iiS(s3Return ``supports_sane_rowcount`` from the dialect.(RQtsupports_sane_rowcount(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRN=scCs |iiS(s9Return ``supports_sane_multi_rowcount`` from the dialect.(RQtsupports_sane_multi_rowcount(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyROBscsyi|\}}}Wn_tj oSt|to9|it}tfdt|DSnX|o||S|SdS(Nc3s%x|]}i|VqWdS(N(R (RR (RR(s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pys Os (R)t TypeErrorRtslicetindicesRRR (RRRR?t processortindexRR((RRs:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR Gs$cCs |iiS(N(R9RJ(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt_fetchone_implXscCs|ii|S(N(R9t fetchmany(Rtsize((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt_fetchmany_impl[scCs |iiS(N(R9tfetchall(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt_fetchall_impl^sc CsyK|i}g}|iD]}||||q~}|i|SWn:tj o.}|ii|dd|i|inXdS(s7Fetch all rows, just like DB-API ``cursor.fetchall()``.N( t _process_rowRZRRRRRDR9R<(Rt process_rowRRtlR?((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRYas 0 "c Csye|i}g}|i|D]}||||q ~}t|djo|in|SWn:tj o.}|ii|dd|i|i nXdS(sNFetch many rows, just like DB-API ``cursor.fetchmany(size=cursor.arraysize)``.iN( R[RXRRRRRRDR9R<(RRWR\RRR]R?((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRVms 3"cCs}y<|i}|dj o|i||S|idSWn:tj o.}|ii|dd|i|inXdS(s6Fetch one row, just like DB-API ``cursor.fetchone()``.N( RURDR[RRRRR9R<(RRR?((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRJzs   "c Csy|i}Wn:tj o.}|ii|dd|i|inXz*|dj o|i||dSdSWd|iXdS(sBFetch the first column of the first row, and close the result set.iN( RURRRRDR9R<R[R(RRR?((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR`s" N(!RARBRCR R[RVRR"R#R$RR*R7RRRRMRORNRPRLRMRNROR RURDRXRZRYRVRJR`(((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR gs8  8                 cBsgeZdZdZhdd6dd6dd6dd6dd6ZdZd Zd d Zd Z RS( s_A ResultProxy with row buffering behavior. ``ResultProxy`` that buffers the contents of a selection of rows before ``fetchone()`` is called. This is to allow the results of ``cursor.description`` to be available immediately, when interfacing with a DB-API that requires rows to be consumed before this information is available (currently psycopg2, when used with server-side cursors). The pre-fetching behavior fetches only one row initially, and then grows its buffer size by a fixed amount with each successive need for additional rows up to a size of 100. cCs!|itt|idS(N(t$_BufferedRowResultProxy__buffer_rowsRRR(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs iii ii2idcCsCt|dd}|ii||_|ii|||_dS(Nt_bufsizei(RR9RVt"_BufferedRowResultProxy__rowbuffert size_growthRR_(RRW((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt __buffer_rowsscCs^|iodSt|idjo)|it|idjodSn|iidS(Ni(RuRDRR`R^tpop(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRUs   cCsOg}xBtd|D]1}|i}|djoPn|i|qW|S(Ni(trangeRURDR8(RRWRJR&R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRXs  cCs|it|iiS(N(R`RR9RY(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRZsN( RARBRCRRaR^RURDRXRZ(((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs    cBs2eZdZeZdZdZddZRS(s A ResultProxy with column buffering behavior. ``ResultProxy`` that loads all columns into memory each time fetchone() is called. If fetchmany() or fetchall() are called, the full grid of results is fetched. This is to operate with databases where result rows contain "live" results that fall out of scope unless explicitly fetched. Currently this includes just cx_Oracle LOB objects, but this behavior is known to exist in other DB-APIs as well (Pygresql, currently unsupported). csyi|}|dSWn_tj oSt|to9|it}tfdt|DSnXdS(Nic3s%x|]}i|VqWdS(N(R (RR (RR(s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pys s (R)RPRRQRRRRR (RRRR@RR((RRs:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR s $cCsDg}x7to/|i}|djoPn|i|q W|S(N(RERJRDR8(RR]R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRYs  cCsd|djo |iSg}x?t|D]1}|i}|djoPn|i|q+W|S(N(RDRYR RJR8(RRWR]R R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRVs     N( RARBRCRR[R RYRDRV(((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs   cBs)eZdZdZdZdZRS(sTA visitor that can gather text into a buffer and execute the contents of the buffer.cCs||_ti|_dS(sConstruct a new SchemaIterator.N(RRtbuffer(RR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRVs cCs|ii|dS(s4Append content to the SchemaIterator's query buffer.N(Retwrite(Rts((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR8 scCs5z|ii|iiSWd|iidXdS(s4Execute the contents of the SchemaIterator's buffer.Ni(RR_Retgetvaluettruncate(R((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyR_s(RARBRCRVR8R_(((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs  cBsbeZdZdZdZdZdZdZdZd dZ dZ d Z RS( soA visitor which accepts ColumnDefault objects, produces the dialect-specific SQL corresponding to their execution, and executes the SQL, returning the result value. DefaultRunners are used internally by Engines and Dialects. Specific database modules should provide their own subclasses of DefaultRunner to allow database-specific behavior. cCs%||_|i|_|i|_dS(N(R<RQR9(RR<((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRV#s  cCs)|idj o|i|iSdSdS(N(RRDR(Rtcolumn((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytget_column_default(scCs)|idj o|i|iSdSdS(N(tonupdateRDR(RRj((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytget_column_onupdate.scCsdS(N(RD(RR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytvisit_passive_default4scCsdS(N(RD(Rtseq((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytvisit_sequence7scCsF|ii}ti|igid|}|i|dhiS(NRS((R<RRRtargRWR]R`(RRRR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytexec_default_sql:s !cCsj|ii}t|to'|ii o|i|ii}n|i|i |||i i dS(sMexecute a string statement, using the raw cursor, and return a scalar result.i( R<t _connectionRtunicodeRQtsupports_unicode_statementstencodetencodingRR9RJ(RtstmtRZR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytexecute_string?s  cCsSt|itio|i|Sti|io|i|iS|iSdS(N(RRqRRRrRtcallableR<(RRl((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytvisit_column_onupdateHs cCsSt|itio|i|Sti|io|i|iS|iSdS(N(RRqRRRrRRzR<(RR((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pytvisit_column_defaultPs N( RARBRCRVRkRmRnRpRrRDRyR{R|(((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRs        cstifd}|S(sDecorator, memoize a function in a connection.info stash. Only applicable to functions which take no arguments other than a connection. The memo will be stored in ``connection.info[key]``. csP|i}y|iSWn.tj o"||||i<}|SXdS(N(R{RzR(tfnRRtval(R(s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyt decorated`s  (Rt decorator(RR((Rs:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyRYs (!RCt__all__tinspectRt sqlalchemyRRRRRtsqlalchemy.sqlRRgRR RRRRR R RRRR RR RRt SchemaVisitorRRR(((s:/usr/lib/python2.6/site-packages/sqlalchemy/engine/base.pyts6(J9   S1:1A