ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ 4]c@sdZddlZddlZddlmZddlmZddlmZddlmZddlmZ yddl m Z d Z Wne k rd Z nXydd l mZeZWn-e k reZd efd YZnXdefdYZyejjjeWne k r2nXdefdYZdefdYZdefdYZdefdYZdefdYZdefdYZdS(sSDefine result set constructs including :class:`.ResultProxy` and :class:`.RowProxy.iNi(texc(tutil(t expression(tsqltypes(tsafe_rowproxy_reconstructorcCs t||S(N(R(tclststate((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pytrowproxy_reconstructor!scCs |j|}|j||S(N(t__new__t __setstate__(RRtobj((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyR's (t BaseRowProxyR cBsMeZd ZdZdZdZdZdZd Zd Z RS( t_parentt_rowt _processorst_keymapcCs(||_||_||_||_dS(s8RowProxy objects are constructed by ResultProxy objects.N(R R RR(tselftparenttrowt processorstkeymap((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt__init__7s   cCst|j|jffS(N(Rt __class__t __getstate__(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt __reduce__?scCs t|S(s9Return the values represented by this RowProxy as a list.(tlist(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pytvaluesEsccsIxBt|j|jD]+\}}|dkr6|Vq||VqWdS(N(tzipRR tNone(Rt processortvalue((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt__iter__Is" cCs t|jS(N(tlenR (R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt__len__PscCs&y|j|\}}}Wntk rH|jj|\}}}ntk rt|trg}xZt|j||j |D];\}}|dkr|j |q|j ||qWt |SnX|dkrt jd|n|dk r||j |S|j |SdS(Ns<Ambiguous column name '%s' in result set column descriptions(RtKeyErrorR t _key_fallbackt TypeErrort isinstancetsliceRRR RtappendttupleRtInvalidRequestError(RtkeyRR tindextlR((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt __getitem__Ss*  $     cCs9y ||SWn&tk r4}t|jdnXdS(Ni(R"tAttributeErrortargs(Rtnamete((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt __getattr__os (R R RR( t__name__t __module__t __slots__RRRRR!R-R2(((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyR 4s      tRowProxycBseZdZdZdZdZdZdZdZ dZ dZ dZ dZ d Zd Zd Zd Zd ZdZdZdZRS(sxProxy values from a single cursor row. 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). cCs|jj|S(N(R t_has_key(RR*((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt __contains__scCsi|jd6t|d6S(NR R (R R((R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRscCs:|d|_}|d|_|j|_|j|_dS(NR R (R R RR(RRR((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyR s  cCs;t|tr(|t|t|S|t||S(N(R%R6R((Rtothertop((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt_ops(cCs|j|tjS(N(R;toperatortlt(RR9((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt__lt__scCs|j|tjS(N(R;R<tle(RR9((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt__le__scCs|j|tjS(N(R;R<tge(RR9((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt__ge__scCs|j|tjS(N(R;R<tgt(RR9((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt__gt__scCs|j|tjS(N(R;R<teq(RR9((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt__eq__scCs|j|tjS(N(R;R<tne(RR9((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt__ne__scCsttj|S(N(treprtsql_utilt _repr_row(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt__repr__scCs|jj|S(s4Return True if this RowProxy contains the given key.(R R7(RR*((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pythas_keyscCs'g|jD]}|||f^q S(s@Return a list of tuples, each tuple containing a key/value pair.(tkeys(RR*((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pytitemsscCs |jjS(s@Return the list of keys as strings represented by this RowProxy.(R RN(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRNscCst|jjS(N(titerR RN(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pytiterkeysscCs t|S(N(RP(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt itervaluess(N(R3R4t__doc__R5R8RR Rt__hash__R;R>R@RBRDRFRHRLRMRORNRQRR(((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyR6vs&               tResultMetaDatacBseZdZdZdZdZd Zd Zd Zd Z e e d Z e dZ dZe dZdZdZRS(sRHandle cursor.description, applying additional info from an execution context.Rtcase_sensitivetmatched_on_nameRRNt_orig_processorsc Csx|j}|j}|j|_t|_d|_|jrZ|j\}}}t|}nt}}}}|j ||||||} i|_ t s$t| } |j j g| D]+} | d| d| d| dff^qg| D]/} | d| | d| d| dff^qng| D]} | d^q+|_ tg| D]+} | d| d| d| dff^qN} |rt| |krt} xb| D]Z}|d}|| kr|js|jn|}d|df| | >       ,   @   < c CsW|jj}|r|r| r|t|krg|D]}|d^q8|_gt|D]Y\} \} } } } | | |s| jn| |j| | || d| df^q^S|r|j|||}n0|r|j |||}n|j ||}g|D]?\} }}}} }| |||j|||| |f^qSdS(s Merge a cursor.description with compiled result column information. There are at least four separate strategies used here, selected depending on the type of SQL construct used to start with. The most common case is that of the compiled SQL expression construct, which generated the column names present in the raw SQL string and which has the identical number of columns as were reported by cursor.description. In this case, we assume a 1-1 positional mapping between the entries in cursor.description and the compiled object. This is also the most performant case as we disregard extracting / decoding the column names present in cursor.description since we already have the desired name we generated in the compiled SQL construct. The next common case is that of the completely raw string SQL, such as passed to connection.execute(). In this case we have no compiled construct to work with, so we extract and decode the names from cursor.description and index those as the primary result row target keys. The remaining fairly common case is that of the textual SQL that includes at least partial column information; this is when we use a :class:`.TextAsFrom` construct. This construct may have unordered or ordered column information. In the ordered case, we merge the cursor.description and the compiled construct's information positionally, and warn if there are additional description names present, however we still decode the names in cursor.description as we don't have a guarantee that the names in the columns match on these. In the unordered case, we match names in cursor.description to that of the compiled construct based on name matching. In both of these cases, the cursor.description names and the column expression objects and names are indexed as result row target keys. The final case is much less common, where we have a compiled non-textual SQL expression construct, but the number of columns in cursor.description doesn't match what's in the compiled construct. We make the guess here that there might be textual column expressions in the compiled construct that themselves include a comma in them causing them to split. We do the same name-matching as with textual non-ordered columns. The name-matched system of merging is the same as that used by SQLAlchemy for all cases up through te 0.9 series. Positional matching for compiled SQL expressions was introduced in 1.0 as a major performance feature, and positional matching for textual :class:`.TextAsFrom` objects in 1.1. As name matching is no longer a common case, it was acceptable to factor it into smaller generator- oriented methods that are easier to understand, but incur slightly more performance overhead. iiN( RZRVR RNt enumerateRbtget_result_processorRt_merge_textual_cols_by_positiont_merge_cols_by_namet_merge_cols_by_none(RRYReRfRiRgRhRVRltidxR*R0R ttype_t raw_iteratortcolnamet mapped_typetcoltypet untranslated((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyR]Ns$>   g c cs |j}|j}|j}|jr-|jnd}|jrE|jnd}d}g|_xt |D]\} } | d} | d} |r|| } n|r|| \} }n|r|| } n|jj | |s| j } n| | || fVqgWdS(sExtract column names and data types from a cursor.description. Applies unicode decoding, column translation, "normalization", and case sensitivity rules to the names based on the dialect. iiN( RZRVRdtdescription_encodingt_description_decoderRtrequires_name_normalizetnormalize_nameRNRqR'Rb( RRYReRZRVttranslate_colnametdescription_decoderRR|RvRoRyR{((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt_colnames_from_descriptions*      c cs|rt|nd}|t|krJtjd|t|fnt}x|j||D]\}}}} ||kr||} | d} | d} | d|krtjd| dn|j| dnt j } d} ||| | | |fVqfWdS(NsVNumber of columns in textual SQL (%d) is smaller than number of columns requested (%d)iiis8Duplicate column expression requested in textual SQL: %r( R RRtwarnRaRRR)RcRtNULLTYPE( RRYReRfRiRnRvRyR|R{tctx_recR Rz((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRss( "     ccs|j}|j}|j||}t|_x|j||D]n\}}} } y||} Wn tk rtj} d} nX| d} | d} ||| | | | fVq@WdS(Nii( RZRVt_create_result_maptTrueRWRR"RRR(RRYReRfRZRVt result_mapRvRyR|R{RRzR ((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRts   "     ccsGx@|j||D],\}}}}||tj|d|fVqWdS(N(RRRR(RRYReRvRyR|R{((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRu/s"c Csi}x|D]w}|d|d}}|s=|j}n||krz||\}}} |||d| f||st_pickled_keymapRNRVRW(R`RRORNRVRW(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRs  cCsgtt|dD] }d^q|_i|_}x1|djD]\}}dd|f||s( t_cursor_descriptionRRYtcompiledtexecution_optionst_cached_metadataRRURRtloggertdebugR((RRe((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRs   " cCs|jr|jjSgSdS(s/Return the current set of string keys for rows.N(RRN(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRNs  cCsJy|jjSWn5tk rE}|jj|dd|j|jnXdS(sReturn the 'rowcount' for this result. The 'rowcount' reports the number of rows *matched* by the WHERE criterion of an UPDATE or DELETE statement. .. note:: Notes regarding :attr:`.ResultProxy.rowcount`: * This attribute returns the number of rows *matched*, which is not necessarily the same as the number of rows that were actually *modified* - an UPDATE statement, for example, may have no net change on a given row if the SET values given are the same as those present in the row already. Such a row would be matched but not modified. On backends that feature both styles, such as MySQL, rowcount is configured by default to return the match count in all cases. * :attr:`.ResultProxy.rowcount` is *only* useful in conjunction with an UPDATE or DELETE statement. Contrary to what the Python DBAPI says, it does *not* return the number of rows available from the results of a SELECT statement as DBAPIs cannot support this functionality when rows are unbuffered. * :attr:`.ResultProxy.rowcount` may not be fully implemented by all dialects. In particular, most DBAPIs do not support an aggregate rowcount result from an executemany call. The :meth:`.ResultProxy.supports_sane_rowcount` and :meth:`.ResultProxy.supports_sane_multi_rowcount` methods will report from the dialect if each usage is known to be supported. * Statements that use RETURNING may not return a correct rowcount. N(RYtrowcountt BaseExceptionRt_handle_dbapi_exceptionRR(RR1((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRs ) cCsJy|jjSWn5tk rE}|jj|dd|j|jnXdS(s/return the 'lastrowid' accessor on the DBAPI cursor. This is a DBAPI specific method and is only functional for those backends which support it, for statements where it is appropriate. It's behavior is not consistent across backends. Usage of this method is normally unnecessary when using insert() expression constructs; the :attr:`~ResultProxy.inserted_primary_key` attribute provides a tuple of primary key values for a newly inserted row, regardless of database backend. N(Rt lastrowidRRRRRY(RR1((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyR-s  cCs |jdk S(sTrue if this :class:`.ResultProxy` returns rows. I.e. if it is legal to call the methods :meth:`~.ResultProxy.fetchone`, :meth:`~.ResultProxy.fetchmany` :meth:`~.ResultProxy.fetchall`. N(RR(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt returns_rowsDs cCs |jjS(sdTrue if this :class:`.ResultProxy` is the result of a executing an expression language compiled :func:`.expression.insert` construct. When True, this implies that the :attr:`inserted_primary_key` attribute is accessible, assuming the statement did not include a user defined "returning" construct. (RYtisinsert(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt is_insertPs cCs |jjS(s May be overridden by subclasses.(Rt description(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyR^scCsU|jr dSt|_|j}|jj||jrH|jjnd|_dS(slSoft close this :class:`.ResultProxy`. This releases all DBAPI cursor resources, but leaves the ResultProxy "open" from a semantic perspective, meaning the fetchXXX() methods will continue to return empty results. This method is called automatically when: * all result rows are exhausted using the fetchXXX() methods. * cursor.description is None. This method is **not public**, but is documented in order to clarify the "autoclose" process used. .. versionadded:: 1.0.0 .. seealso:: :meth:`.ResultProxy.close` N(t _soft_closedRRRt_safe_close_cursort_autoclose_connectiontcloseR(RR((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt _soft_closecs    cCs#|js|jt|_ndS(sClose this ResultProxy. This closes out the underlying DBAPI cursor corresponding to the statement execution, if one is still present. Note that the DBAPI cursor is automatically released when the :class:`.ResultProxy` exhausts all available rows. :meth:`.ResultProxy.close` is generally an optional method except in the case when discarding a :class:`.ResultProxy` that still has additional rows pending for fetch. In the case of a result that is the product of :ref:`connectionless execution `, the underlying :class:`.Connection` object is also closed, which :term:`releases` DBAPI connection resources. After this method is called, it is no longer valid to call upon the fetch methods, which will raise a :class:`.ResourceClosedError` on subsequent use. .. versionchanged:: 1.0.0 - the :meth:`.ResultProxy.close` method has been separated out from the process that releases the underlying DBAPI cursor resource. The "auto close" feature of the :class:`.Connection` now performs a so-called "soft close", which releases the underlying DBAPI cursor, but allows the :class:`.ResultProxy` to still behave as an open-but-exhausted result set; the actual :meth:`.ResultProxy.close` method is never called. It is still safe to discard a :class:`.ResultProxy` that has been fully exhausted without calling this method. .. seealso:: :ref:`connections_toplevel` :meth:`.ResultProxy._soft_close` N(tclosedRR(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRs%  ccs2x+tr-|j}|dkr%dS|VqWdS(sImplement iteration protocol.N(RtfetchoneR(RR((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRs    cCs,|j}|dkr$tn|SdS(sGImplement the next() protocol. .. versionadded:: 1.2 N(RRt StopIteration(RR((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt__next__s   cCsd|jjstjdn<|jjs<tjdn|jjrZtjdn|jjS(sReturn the primary key for the row just inserted. The return value is a list of scalar values corresponding to the list of primary key columns in the target table. This only applies to single row :func:`.insert` constructs which did not explicitly specify :meth:`.Insert.returning`. Note that primary key columns which specify a server_default clause, or otherwise do not qualify as "autoincrement" columns (see the notes at :class:`.Column`), and were generated using the database-side default, will appear in this list as ``None`` unless the backend supports "returning" and the insert statement executed with the "implicit returning" enabled. Raises :class:`~sqlalchemy.exc.InvalidRequestError` if the executed statement is not a compiled expression construct or is not an insert() construct. s1Statement is not a compiled expression construct.s2Statement is not an insert() expression construct.s9Can't call inserted_primary_key when returning() is used.(RYRRR)Rt_is_explicit_returningtinserted_primary_key(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRs      cCsd|jjstjdnB|jjs<tjdn$|jjrR|jjS|jjdSdS(sReturn the collection of updated parameters from this execution. Raises :class:`~sqlalchemy.exc.InvalidRequestError` if the executed statement is not a compiled expression construct or is not an update() construct. s1Statement is not a compiled expression construct.s2Statement is not an update() expression construct.iN(RYRRR)tisupdatet executemanytcompiled_parameters(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pytlast_updated_paramss      cCsd|jjstjdnB|jjs<tjdn$|jjrR|jjS|jjdSdS(sReturn the collection of inserted parameters from this execution. Raises :class:`~sqlalchemy.exc.InvalidRequestError` if the executed statement is not a compiled expression construct or is not an insert() construct. s1Statement is not a compiled expression construct.s2Statement is not an insert() expression construct.iN(RYRRR)RRR(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pytlast_inserted_paramss      cCs |jjS(sReturn the values of default columns that were fetched using the :meth:`.ValuesBase.return_defaults` feature. The value is an instance of :class:`.RowProxy`, or ``None`` if :meth:`.ValuesBase.return_defaults` was not used or if the backend does not support RETURNING. .. versionadded:: 0.9.0 .. seealso:: :meth:`.ValuesBase.return_defaults` (RYtreturned_defaults(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRscCs |jjS(sReturn ``lastrow_has_defaults()`` from the underlying :class:`.ExecutionContext`. See :class:`.ExecutionContext` for details. (RYtlastrow_has_defaults(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyR.scCsT|jjstjdn,|jj rJ|jj rJtjdn|jjS(sMReturn ``postfetch_cols()`` from the underlying :class:`.ExecutionContext`. See :class:`.ExecutionContext` for details. Raises :class:`~sqlalchemy.exc.InvalidRequestError` if the executed statement is not a compiled expression construct or is not an insert() or update() construct. s1Statement is not a compiled expression construct.s>Statement is not an insert() or update() expression construct.(RYRRR)RRtpostfetch_cols(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyR8s   cCsT|jjstjdn,|jj rJ|jj rJtjdn|jjS(sLReturn ``prefetch_cols()`` from the underlying :class:`.ExecutionContext`. See :class:`.ExecutionContext` for details. Raises :class:`~sqlalchemy.exc.InvalidRequestError` if the executed statement is not a compiled expression construct or is not an insert() or update() construct. s1Statement is not a compiled expression construct.s>Statement is not an insert() or update() expression construct.(RYRRR)RRt prefetch_cols(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyROs   cCs |jjS(sxReturn ``supports_sane_rowcount`` from the dialect. See :attr:`.ResultProxy.rowcount` for background. (RZtsupports_sane_rowcount(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRfscCs |jjS(s~Return ``supports_sane_multi_rowcount`` from the dialect. See :attr:`.ResultProxy.rowcount` for background. (RZtsupports_sane_multi_rowcount(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRoscCs3y|jjSWntk r.|jdSXdS(N(RRR.RR(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt_fetchone_implxs cCsOy-|dkr|jjS|jj|SWntk rJ|jgSXdS(N(RRt fetchmanyR.R(Rtsize((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt_fetchmany_impl~s    cCs3y|jjSWntk r.|jgSXdS(N(RtfetchallR.R(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt_fetchall_impls cCsD|jdkr!tjdn|jr<tjdn|SdS(NsJThis result object does not return rows. It has been closed automatically.sThis result object is closed.(RRRtResourceClosedErrorR(Rtdefault((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRs   c Cs|j}|j}|j}|j}|jr|jjjj}g}x@|D]8}|dt j ||j |||||qLW|Sg|D]}|||||^qSdS(NsRow %r( t _process_rowRRRRRYRRRRJRKR'( Rtrowst process_rowtmetadataRRtlogR,R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt process_rowss       cCscy'|j|j}|j|SWn5tk r^}|jj|dd|j|jnXdS(svFetch all rows, just like DB-API ``cursor.fetchall()``. After all rows have been exhausted, the underlying DBAPI cursor resource is released, and the object may be safely discarded. Subsequent calls to :meth:`.ResultProxy.fetchall` will return an empty list. After the :meth:`.ResultProxy.close` method is called, the method will raise :class:`.ResourceClosedError`. .. versionchanged:: 1.0.0 - Added "soft close" behavior which allows the result to be used in an "exhausted" state prior to calling the :meth:`.ResultProxy.close` method. N( RRRRRRRRRY(RR,R1((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRs  cCs{y?|j|j|}t|dkr:|jn|SWn5tk rv}|jj|dd|j|j nXdS(sFetch many rows, just like DB-API ``cursor.fetchmany(size=cursor.arraysize)``. After all rows have been exhausted, the underlying DBAPI cursor resource is released, and the object may be safely discarded. Calls to :meth:`.ResultProxy.fetchmany` after all rows have been exhausted will return an empty list. After the :meth:`.ResultProxy.close` method is called, the method will raise :class:`.ResourceClosedError`. .. versionchanged:: 1.0.0 - Added "soft close" behavior which allows the result to be used in an "exhausted" state prior to calling the :meth:`.ResultProxy.close` method. iN( RRR RRRRRRRY(RRR,R1((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRs  cCszy>|j}|dk r/|j|gdS|jdSWn5tk ru}|jj|dd|j|jnXdS(sFetch one row, just like DB-API ``cursor.fetchone()``. After all rows have been exhausted, the underlying DBAPI cursor resource is released, and the object may be safely discarded. Calls to :meth:`.ResultProxy.fetchone` after all rows have been exhausted will return ``None``. After the :meth:`.ResultProxy.close` method is called, the method will raise :class:`.ResourceClosedError`. .. versionchanged:: 1.0.0 - Added "soft close" behavior which allows the result to be used in an "exhausted" state prior to calling the :meth:`.ResultProxy.close` method. iN( RRRRRRRRRY(RRR1((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRs    cCs|jdkr|jdSy|j}Wn5tk rc}|jj|dd|j|jnXz(|dk r|j |gdSdSWd|j XdS(sFetch the first row and then close the result set unconditionally. Returns None if no row is present. After calling this method, the object is fully closed, e.g. the :meth:`.ResultProxy.close` method will have been called. iN( RRRRRRRRRYRR(RRR1((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pytfirsts    cCs(|j}|dk r |dSdSdS(sFetch the first column of the first row, and close the result set. Returns None if no row is present. After calling this method, the object is fully closed, e.g. the :meth:`.ResultProxy.close` method will have been called. iN(RR(RR((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pytscalars  N(2R3R4RSR6RRtout_parametersR[RRRRRRRR7RRNRtmemoized_propertyRtpropertyRRRRRRRRtnextRRRRRRRRRRRRRRRRRRR(((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRsR    0   ) ,           tBufferedRowResultProxycBseZdZdZidd6dd6dd6dd6dd6dd6d d6d d 6Zd Zd Zd ZddZ dZ RS(sA 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 1000. The size argument is configurable using the ``max_row_buffer`` execution option:: with psycopg2_engine.connect() as conn: result = conn.execution_options( stream_results=True, max_row_buffer=50 ).execute("select * from table") .. versionadded:: 1.0.6 Added the ``max_row_buffer`` option. .. seealso:: :ref:`psycopg2_execution_options` cCs<|jjjdd|_|jtt|jdS(Ntmax_row_buffer( RYRRRt_max_row_buffert$_BufferedRowResultProxy__buffer_rowstsuperRR(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRFs  iii ii2idiiicCs|jdkrdSt|dd}tj|jj||_|jj|||_ |j dk rt |j |j |_ ndS(Nt_bufsizei( RRtgetattrt collectionstdequeRt"_BufferedRowResultProxy__rowbuffert size_growthRRRtmin(RR((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyt __buffer_rows\scKs'|jjtt|j|dS(N(RtclearRRR(Rtkw((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRes cCsL|jdkr|jdS|js?|j|js?dSn|jjS(N(RRRRRtpopleft(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRis    cCsc|dkr|jSg}x@td|D]/}|j}|dkrNPn|j|q,W|S(Ni(RRRRR'(RRRRR((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRrs    cCsQ|jdkr|jgS|jj|jj|j}tj|_|S(N(RRRRtextendRRR(RR((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyR}s   N( R3R4RSRRRRRRRR(((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyR(s     tFullyBufferedResultProxycBsGeZdZdZdZdZdZddZdZ RS(sA result proxy that buffers rows fully upon creation. Used for operations where a result is to be delivered after the database conversation can not be continued, such as MSSQL INSERT...OUTPUT after an autocommit. cCs&tt|j|j|_dS(N(RRRt _buffer_rowst$_FullyBufferedResultProxy__rowbuffer(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRscCstj|jjS(N(RRRR(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRscKs'|jjtt|j|dS(N(RRRRR(RR((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRs cCs'|jr|jjS|jdSdS(N(RRRR(R((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRs  cCsc|dkr|jSg}x@td|D]/}|j}|dkrNPn|j|q,W|S(Ni(RRRRR'(RRRRR((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRs    cCs2|js|jgS|j}tj|_|S(N(RRRRR(RR((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRs    N( R3R4RSRRRRRRR(((sK/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/engine/result.pyRs     tBufferedColumnRowcBseZdZRS(cCst|}d}x>|jD]3}|dk rE||||| s@       BL ~^-