
    ,hZw                    H   S SK Jr  S SKrS SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJ	r	  S S	KJ
r
  S S
KJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK J!r!  SSK J"r"  \
(       a  SSKJ#r#  SSKJ$r$  SSKJ%r%  \" S\S 9r&\" S!\	\S"4   S 9r' " S# S$\\   5      r( " S% S&\\(\\'      5      r) " S' S(\(\   5      r* " S) S*\\(\   5      r+ " S+ S,\(\   \RX                  5      r-\" S-S.S 9r.S0S/ jr/g)1    )annotationsN)Any)AsyncIterator)Optional)overload)Sequence)Tuple)TYPE_CHECKING)TypeVar   )exc   )util)Result)_NO_ROW)_R)	_WithKeys)FilterResult)FrozenResult)ResultMetaData)Row)
RowMapping)_generative)greenlet_spawn)Literal)Self)CursorResult)_KeyIndexType)_UniqueFilterType_T)bound_TP.c                  L    \ rS rSr% SrS\S'   S\S'   S
S jr\SS j5       rSr	g	)AsyncCommon,    Result[Any]_real_resultr   	_metadatac                ^   #    [        U R                  R                  5      I Sh  vN   g N7f)zClose this result.N)r   r(   closeselfs    U/var/www/auris/envauris/lib/python3.13/site-packages/sqlalchemy/ext/asyncio/result.pyr+   AsyncCommon.close2   s!      T..44555s   #-+-c                .    U R                   R                  $ )zproxies the .closed attribute of the underlying result object,
if any, else raises ``AttributeError``.

.. versionadded:: 2.0.0b3

)r(   closedr,   s    r.   r1   AsyncCommon.closed7   s       '''    N)returnNone)r4   bool)
__name__
__module____qualname____firstlineno__	__slots____annotations__r+   propertyr1   __static_attributes__r&   r3   r.   r$   r$   ,   s,    I6
 ( (r3   r$   c                     \ rS rSr% SrSrS\S'   S&S jr\S'S j5       r	S'S jr
\S(S)S
 jj5       rS*S jr S(   S+S jjrS,S jrS-S jr S(   S.S jjrS,S jrS/S jrS0S jrS-S jrS-S jr\S1S j5       r\S2S j5       rS2S jr\    S3S j5       r\S4S j5       rS4S jrS0S jr\S3S j5       r\S2S j5       rS2S jrS5S jr\      S6S  j5       r\S7S! j5       r\S8S9S" jj5       rS8S9S# jjrS:S$ jrS%rg	);AsyncResultB   a4  An asyncio wrapper around a :class:`_result.Result` object.

The :class:`_asyncio.AsyncResult` only applies to statement executions that
use a server-side cursor.  It is returned only from the
:meth:`_asyncio.AsyncConnection.stream` and
:meth:`_asyncio.AsyncSession.stream` methods.

.. note:: As is the case with :class:`_engine.Result`, this object is
   used for ORM results returned by :meth:`_asyncio.AsyncSession.execute`,
   which can yield instances of ORM mapped objects either individually or
   within tuple-like rows.  Note that these result objects do not
   deduplicate instances or rows automatically as is the case with the
   legacy :class:`_orm.Query` object. For in-Python de-duplication of
   instances or rows, use the :meth:`_asyncio.AsyncResult.unique` modifier
   method.

.. versionadded:: 1.4

r&   Result[_TP]r(   c                    Xl         UR                  U l        UR                  U l        UR                  U l        S U l        SUR
                  ;   a   U R                  SUR
                  S   5        g g )N_row_getter)r(   r)   _unique_filter_state_source_supports_scalars_post_creational_filter__dict___set_memoized_attribute)r-   real_results     r.   __init__AsyncResult.__init__[   sl    '$..$/$D$D!(3(L(L%'+$ K000(({33MB 1r3   c                    U $ )zApply a "typed tuple" typing filter to returned rows.

The :attr:`_asyncio.AsyncResult.t` attribute is a synonym for
calling the :meth:`_asyncio.AsyncResult.tuples` method.

.. versionadded:: 2.0

r&   r,   s    r.   tAsyncResult.tj   s	     r3   c                    U $ )a  Apply a "typed tuple" typing filter to returned rows.

This method returns the same :class:`_asyncio.AsyncResult` object
at runtime,
however annotates as returning a :class:`_asyncio.AsyncTupleResult`
object that will indicate to :pep:`484` typing tools that plain typed
``Tuple`` instances are returned rather than rows.  This allows
tuple unpacking and ``__getitem__`` access of :class:`_engine.Row`
objects to by typed, for those cases where the statement invoked
itself included typing information.

.. versionadded:: 2.0

:return: the :class:`_result.AsyncTupleResult` type at typing time.

.. seealso::

    :attr:`_asyncio.AsyncResult.t` - shorter synonym

    :attr:`_engine.Row.t` - :class:`_engine.Row` version

r&   r,   s    r.   tuplesAsyncResult.tuplesv   s	    0 r3   Nc                (    [        5       U4U l        U $ )zApply unique filtering to the objects returned by this
:class:`_asyncio.AsyncResult`.

Refer to :meth:`_engine.Result.unique` in the synchronous
SQLAlchemy API for a complete behavioral description.

setrE   r-   strategys     r.   uniqueAsyncResult.unique   s     &)UH$5!r3   c                $    U R                  U5      $ )zEstablish the columns that should be returned in each row.

Refer to :meth:`_engine.Result.columns` in the synchronous
SQLAlchemy API for a complete behavioral description.

_column_slicesr-   col_expressionss     r.   columnsAsyncResult.columns   s     ""?33r3   c               p   #    U R                   n [        X U5      I Sh  vN nU(       a  U7v   OgM$   N7f)a  Iterate through sub-lists of rows of the size given.

An async iterator is returned::

    async def scroll_results(connection):
        result = await connection.stream(select(users_table))

        async for partition in result.partitions(100):
            print("list of rows: %s" % partition)

Refer to :meth:`_engine.Result.partitions` in the synchronous
SQLAlchemy API for a complete behavioral description.

N_manyrow_getterr   r-   sizegetter	partitions       r.   
partitionsAsyncResult.partitions   s7     $ %%,V4@@I @   646c                H   #    [        U R                  5      I Sh  vN $  N7f)zSA synonym for the :meth:`_asyncio.AsyncResult.all` method.

.. versionadded:: 2.0

Nr   _allrowsr,   s    r.   fetchallAsyncResult.fetchall   s      $DMM2222   " "c                b   #    [        U R                  U 5      I Sh  vN nU[        L a  gU$  N7f)a  Fetch one row.

When all rows are exhausted, returns None.

This method is provided for backwards compatibility with
SQLAlchemy 1.x.x.

To fetch the first row of a result only, use the
:meth:`_asyncio.AsyncResult.first` method.  To iterate through all
rows, iterate the :class:`_asyncio.AsyncResult` object directly.

:return: a :class:`_engine.Row` object if no filters are applied,
 or ``None`` if no rows remain.

Nr   _onerow_getterr   r-   rows     r.   fetchoneAsyncResult.fetchone   s0       #4#6#6=='>J	 >   /-/c                J   #    [        U R                  X5      I Sh  vN $  N7f)aS  Fetch many rows.

When all rows are exhausted, returns an empty list.

This method is provided for backwards compatibility with
SQLAlchemy 1.x.x.

To fetch rows in groups, use the
:meth:`._asyncio.AsyncResult.partitions` method.

:return: a list of :class:`_engine.Row` objects.

.. seealso::

    :meth:`_asyncio.AsyncResult.partitions`

Nr   rc   r-   re   s     r.   	fetchmanyAsyncResult.fetchmany   s      * $D$8$8$EEEE   #!#c                H   #    [        U R                  5      I Sh  vN $  N7f)zReturn all rows in a list.

Closes the result set after invocation.   Subsequent invocations
will return an empty list.

:return: a list of :class:`_engine.Row` objects.

Nrl   r,   s    r.   allAsyncResult.all   s      $DMM2222rp   c                    U $ Nr&   r,   s    r.   	__aiter__AsyncResult.__aiter__      r3   c                t   #    [        U R                  U 5      I S h  vN nU[        L a
  [        5       eU$  N7fr   r   rs   r   StopAsyncIterationrt   s     r.   	__anext__AsyncResult.__anext__  4     "4#6#6=='>$&&J	 >   868c                N   #    [        U R                  SSS5      I Sh  vN $  N7f)a  Fetch the first row or ``None`` if no row is present.

Closes the result set and discards remaining rows.

.. note::  This method returns one **row**, e.g. tuple, by default.
   To return exactly one single scalar value, that is, the first
   column of the first row, use the
   :meth:`_asyncio.AsyncResult.scalar` method,
   or combine :meth:`_asyncio.AsyncResult.scalars` and
   :meth:`_asyncio.AsyncResult.first`.

   Additionally, in contrast to the behavior of the legacy  ORM
   :meth:`_orm.Query.first` method, **no limit is applied** to the
   SQL query which was invoked to produce this
   :class:`_asyncio.AsyncResult`;
   for a DBAPI driver that buffers results in memory before yielding
   rows, all rows will be sent to the Python process and all but
   the first row will be discarded.

   .. seealso::

        :ref:`migration_20_unify_select`

:return: a :class:`_engine.Row` object, or None
 if no rows remain.

.. seealso::

    :meth:`_asyncio.AsyncResult.scalar`

    :meth:`_asyncio.AsyncResult.one`

FNr   _only_one_rowr,   s    r.   firstAsyncResult.first  s%     D $D$6$6ueLLLL   %#%c                N   #    [        U R                  SSS5      I Sh  vN $  N7f)a  Return at most one result or raise an exception.

Returns ``None`` if the result has no rows.
Raises :class:`.MultipleResultsFound`
if multiple rows are returned.

.. versionadded:: 1.4

:return: The first :class:`_engine.Row` or ``None`` if no row
 is available.

:raises: :class:`.MultipleResultsFound`

.. seealso::

    :meth:`_asyncio.AsyncResult.first`

    :meth:`_asyncio.AsyncResult.one`

TFNr   r,   s    r.   one_or_noneAsyncResult.one_or_none0  s$     * $D$6$6eUKKKKr   c                   #    g 7fr   r&   r,   s    r.   
scalar_oneAsyncResult.scalar_oneG  s     >A   c                   #    g 7fr   r&   r,   s    r.   r   r   J       '*r   c                N   #    [        U R                  SSS5      I Sh  vN $  N7f)a  Return exactly one scalar result or raise an exception.

This is equivalent to calling :meth:`_asyncio.AsyncResult.scalars` and
then :meth:`_asyncio.AsyncScalarResult.one`.

.. seealso::

    :meth:`_asyncio.AsyncScalarResult.one`

    :meth:`_asyncio.AsyncResult.scalars`

TNr   r,   s    r.   r   r   M  s$      $D$6$6dDIIIIr   c                   #    g 7fr   r&   r,   s    r.   scalar_one_or_noneAsyncResult.scalar_one_or_none\  s
      r   c                   #    g 7fr   r&   r,   s    r.   r   r   a  s     9<r   c                N   #    [        U R                  SSS5      I Sh  vN $  N7f)a  Return exactly one scalar result or ``None``.

This is equivalent to calling :meth:`_asyncio.AsyncResult.scalars` and
then :meth:`_asyncio.AsyncScalarResult.one_or_none`.

.. seealso::

    :meth:`_asyncio.AsyncScalarResult.one_or_none`

    :meth:`_asyncio.AsyncResult.scalars`

TFNr   r,   s    r.   r   r   d  s$      $D$6$6eTJJJJr   c                N   #    [        U R                  SSS5      I Sh  vN $  N7f)a  Return exactly one row or raise an exception.

Raises :class:`.NoResultFound` if the result returns no
rows, or :class:`.MultipleResultsFound` if multiple rows
would be returned.

.. note::  This method returns one **row**, e.g. tuple, by default.
   To return exactly one single scalar value, that is, the first
   column of the first row, use the
   :meth:`_asyncio.AsyncResult.scalar_one` method, or combine
   :meth:`_asyncio.AsyncResult.scalars` and
   :meth:`_asyncio.AsyncResult.one`.

.. versionadded:: 1.4

:return: The first :class:`_engine.Row`.

:raises: :class:`.MultipleResultsFound`, :class:`.NoResultFound`

.. seealso::

    :meth:`_asyncio.AsyncResult.first`

    :meth:`_asyncio.AsyncResult.one_or_none`

    :meth:`_asyncio.AsyncResult.scalar_one`

TFNr   r,   s    r.   oneAsyncResult.ones  s$     : $D$6$6dEJJJJr   c                   #    g 7fr   r&   r,   s    r.   scalarAsyncResult.scalar  s     DGr   c                   #    g 7fr   r&   r,   s    r.   r   r     s     #&r   c                N   #    [        U R                  SSS5      I Sh  vN $  N7f)av  Fetch the first column of the first row, and close the result set.

Returns ``None`` if there are no rows to fetch.

No validation is performed to test if additional rows remain.

After calling this method, the object is fully closed,
e.g. the :meth:`_engine.CursorResult.close`
method will have been called.

:return: a Python scalar value, or ``None`` if no rows remain.

FTNr   r,   s    r.   r   r     s$      $D$6$6udKKKKr   c                >   #    [        [        U 5      I Sh  vN $  N7f)a  Return a callable object that will produce copies of this
:class:`_asyncio.AsyncResult` when invoked.

The callable object returned is an instance of
:class:`_engine.FrozenResult`.

This is used for result set caching.  The method must be called
on the result when it has been unconsumed, and calling the method
will consume the result fully.   When the :class:`_engine.FrozenResult`
is retrieved from a cache, it can be called any number of times where
it will produce a new :class:`_engine.Result` object each time
against its stored set of rows.

.. seealso::

    :ref:`do_orm_execute_re_executing` - example usage within the
    ORM to implement a result-set cache.

N)r   r   r,   s    r.   freezeAsyncResult.freeze  s     * $L$7777s   c                    g r   r&   r-   indexs     r.   scalarsAsyncResult.scalars  s     !$r3   c                    g r   r&   r,   s    r.   r   r     s    HKr3   c                    g r   r&   r   s     r.   r   r     s    KNr3   c                .    [        U R                  U5      $ )a  Return an :class:`_asyncio.AsyncScalarResult` filtering object which
will return single elements rather than :class:`_row.Row` objects.

Refer to :meth:`_result.Result.scalars` in the synchronous
SQLAlchemy API for a complete behavioral description.

:param index: integer or row key indicating the column to be fetched
 from each row, defaults to ``0`` indicating the first column.

:return: a new :class:`_asyncio.AsyncScalarResult` filtering object
 referring to this :class:`_asyncio.AsyncResult` object.

)AsyncScalarResultr(   r   s     r.   r   r     s     !!2!2E::r3   c                ,    [        U R                  5      $ )ar  Apply a mappings filter to returned rows, returning an instance of
:class:`_asyncio.AsyncMappingResult`.

When this filter is applied, fetching rows will return
:class:`_engine.RowMapping` objects instead of :class:`_engine.Row`
objects.

:return: a new :class:`_asyncio.AsyncMappingResult` filtering object
 referring to the underlying :class:`_result.Result` object.

)AsyncMappingResultr(   r,   s    r.   mappingsAsyncResult.mappings  s     "$"3"344r3   )r)   rG   r(   rF   rE   )rJ   rB   )r4   zAsyncTupleResult[_TP]r   rW   zOptional[_UniqueFilterType]r4   r   r^   r   r4   r   )re   Optional[int]r4   z!AsyncIterator[Sequence[Row[_TP]]])r4   Sequence[Row[_TP]])r4   zOptional[Row[_TP]])re   r   r4   r   )r4   zAsyncResult[_TP])r4   zRow[_TP])r-   AsyncResult[Tuple[_T]]r4   r    r4   r   )r-   r   r4   Optional[_T]r4   zOptional[Any])r4   zFrozenResult[_TP])r-   r   r   z
Literal[0]r4   AsyncScalarResult[_T])r-   r   r4   r   )r   )r   r   r4   zAsyncScalarResult[Any]r4   r   ) r7   r8   r9   r:   __doc__r;   r<   rK   r=   rN   rQ   r   rX   r_   rh   rn   rv   r|   r   r   r   r   r   r   r   r   r   r   r   r   r   r>   r&   r3   r.   r@   r@   B   s   ( I 	 	4 	 	4 %)!	*63. %)F!F	F.
3"MHL. A A* *J $	  < <KK> G G& &L 8. $$$-7$	$ $ K KN N; 5r3   r@   c                      \ rS rSrSrSrSrSS jr S   SS jjr S   SS jjr	SS	 jr
SSS
 jjrSS jrSS jrSS jrSS jrSS jrSS jrSrg)r   i  a{  A wrapper for a :class:`_asyncio.AsyncResult` that returns scalar values
rather than :class:`_row.Row` values.

The :class:`_asyncio.AsyncScalarResult` object is acquired by calling the
:meth:`_asyncio.AsyncResult.scalars` method.

Refer to the :class:`_result.ScalarResult` object in the synchronous
SQLAlchemy API for a complete behavioral description.

.. versionadded:: 1.4

r&   Fc                    Xl         UR                  (       a  UR                  U l        S U l        O<UR                  R	                  U/5      U l        [
        R                  " S5      U l        UR                  U l        g Nr   )r(   rF   r)   rG   _reduceoperator
itemgetterrE   )r-   rJ   r   s      r.   rK   AsyncScalarResult.__init__  sa    '//(22DN+/D((22::E7CDN+3+>+>q+AD($/$D$D!r3   Nc                (    [        5       U4U l        U $ )zApply unique filtering to the objects returned by this
:class:`_asyncio.AsyncScalarResult`.

See :meth:`_asyncio.AsyncResult.unique` for usage details.

rT   rV   s     r.   rX   AsyncScalarResult.unique       &)UH$5!r3   c               p   #    U R                   n [        X U5      I Sh  vN nU(       a  U7v   OgM$   N7f)zIterate through sub-lists of elements of the size given.

Equivalent to :meth:`_asyncio.AsyncResult.partitions` except that
scalar values, rather than :class:`_engine.Row` objects,
are returned.

Nrb   rd   s       r.   rh   AsyncScalarResult.partitions  7      %%,V4@@I @rj   c                H   #    [        U R                  5      I Sh  vN $  N7f)z@A synonym for the :meth:`_asyncio.AsyncScalarResult.all` method.Nrl   r,   s    r.   rn   AsyncScalarResult.fetchall)        $DMM2222rp   c                J   #    [        U R                  X5      I Sh  vN $  N7f)zFetch many objects.

Equivalent to :meth:`_asyncio.AsyncResult.fetchmany` except that
scalar values, rather than :class:`_engine.Row` objects,
are returned.

Nrz   r{   s     r.   r|   AsyncScalarResult.fetchmany.  s       $D$8$8$EEEEr~   c                H   #    [        U R                  5      I Sh  vN $  N7f)zReturn all scalar values in a list.

Equivalent to :meth:`_asyncio.AsyncResult.all` except that
scalar values, rather than :class:`_engine.Row` objects,
are returned.

Nrl   r,   s    r.   r   AsyncScalarResult.all8  s      $DMM2222rp   c                    U $ r   r&   r,   s    r.   r   AsyncScalarResult.__aiter__B  r   r3   c                t   #    [        U R                  U 5      I S h  vN nU[        L a
  [        5       eU$  N7fr   r   rt   s     r.   r   AsyncScalarResult.__anext__E  r   r   c                N   #    [        U R                  SSS5      I Sh  vN $  N7f)zFetch the first object or ``None`` if no object is present.

Equivalent to :meth:`_asyncio.AsyncResult.first` except that
scalar values, rather than :class:`_engine.Row` objects,
are returned.

FNr   r,   s    r.   r   AsyncScalarResult.firstL  $      $D$6$6ueLLLLr   c                N   #    [        U R                  SSS5      I Sh  vN $  N7f)zReturn at most one object or raise an exception.

Equivalent to :meth:`_asyncio.AsyncResult.one_or_none` except that
scalar values, rather than :class:`_engine.Row` objects,
are returned.

TFNr   r,   s    r.   r   AsyncScalarResult.one_or_noneV  $      $D$6$6eUKKKKr   c                N   #    [        U R                  SSS5      I Sh  vN $  N7f)zReturn exactly one object or raise an exception.

Equivalent to :meth:`_asyncio.AsyncResult.one` except that
scalar values, rather than :class:`_engine.Row` objects,
are returned.

TFNr   r,   s    r.   r   AsyncScalarResult.one`  $      $D$6$6dEJJJJr   )r)   rG   r(   rE   )rJ   r'   r   r   r   r   re   r   r4   zAsyncIterator[Sequence[_R]]r4   Sequence[_R]re   r   r4   r   )r4   zAsyncScalarResult[_R]r4   r   r4   zOptional[_R])r7   r8   r9   r:   r   r;   _generate_rowsrK   rX   rh   rn   r|   r   r   r   r   r   r   r>   r&   r3   r.   r   r     s{     IN
E 15- 
 %)!	$(3
F3MLKr3   r   c                      \ rS rSrSrSrSr\R                  " S5      r	SS jr
 S   SS jjrSS	 jr S   SS
 jjrSS jrSS jr S   SS jjrSS jrSS jrSS jrSS jrSS jrSS jrSrg)r   ik  a  A wrapper for a :class:`_asyncio.AsyncResult` that returns dictionary
values rather than :class:`_engine.Row` values.

The :class:`_asyncio.AsyncMappingResult` object is acquired by calling the
:meth:`_asyncio.AsyncResult.mappings` method.

Refer to the :class:`_result.MappingResult` object in the synchronous
SQLAlchemy API for a complete behavioral description.

.. versionadded:: 1.4

r&   T_mappingc                    Xl         UR                  U l        UR                  U l        UR                  (       a"  U R                  R	                  S/5      U l        g g r   )r(   rE   r)   rF   r   )r-   results     r.   rK   AsyncMappingResult.__init__  sI    "$*$?$?!))**!^^33QC8DN +r3   Nc                (    [        5       U4U l        U $ )zApply unique filtering to the objects returned by this
:class:`_asyncio.AsyncMappingResult`.

See :meth:`_asyncio.AsyncResult.unique` for usage details.

rT   rV   s     r.   rX   AsyncMappingResult.unique  r   r3   c                $    U R                  U5      $ )z:Establish the columns that should be returned in each row.r[   r]   s     r.   r_   AsyncMappingResult.columns  s    ""?33r3   c               p   #    U R                   n [        X U5      I Sh  vN nU(       a  U7v   OgM$   N7f)zIterate through sub-lists of elements of the size given.

Equivalent to :meth:`_asyncio.AsyncResult.partitions` except that
:class:`_engine.RowMapping` values, rather than :class:`_engine.Row`
objects, are returned.

Nrb   rd   s       r.   rh   AsyncMappingResult.partitions  r   rj   c                H   #    [        U R                  5      I Sh  vN $  N7f)zAA synonym for the :meth:`_asyncio.AsyncMappingResult.all` method.Nrl   r,   s    r.   rn   AsyncMappingResult.fetchall  r   rp   c                b   #    [        U R                  U 5      I Sh  vN nU[        L a  gU$  N7f)zFetch one object.

Equivalent to :meth:`_asyncio.AsyncResult.fetchone` except that
:class:`_engine.RowMapping` values, rather than :class:`_engine.Row`
objects, are returned.

Nrr   rt   s     r.   rv   AsyncMappingResult.fetchone  s0      #4#6#6=='>J	 >rx   c                J   #    [        U R                  X5      I Sh  vN $  N7f)zFetch many rows.

Equivalent to :meth:`_asyncio.AsyncResult.fetchmany` except that
:class:`_engine.RowMapping` values, rather than :class:`_engine.Row`
objects, are returned.

Nrz   r{   s     r.   r|   AsyncMappingResult.fetchmany  s       $D$8$8$EEEEr~   c                H   #    [        U R                  5      I Sh  vN $  N7f)zReturn all rows in a list.

Equivalent to :meth:`_asyncio.AsyncResult.all` except that
:class:`_engine.RowMapping` values, rather than :class:`_engine.Row`
objects, are returned.

Nrl   r,   s    r.   r   AsyncMappingResult.all  s      $DMM2222rp   c                    U $ r   r&   r,   s    r.   r   AsyncMappingResult.__aiter__  r   r3   c                t   #    [        U R                  U 5      I S h  vN nU[        L a
  [        5       eU$  N7fr   r   rt   s     r.   r   AsyncMappingResult.__anext__  r   r   c                N   #    [        U R                  SSS5      I Sh  vN $  N7f)zFetch the first object or ``None`` if no object is present.

Equivalent to :meth:`_asyncio.AsyncResult.first` except that
:class:`_engine.RowMapping` values, rather than :class:`_engine.Row`
objects, are returned.

FNr   r,   s    r.   r   AsyncMappingResult.first  r   r   c                N   #    [        U R                  SSS5      I Sh  vN $  N7f)zReturn at most one object or raise an exception.

Equivalent to :meth:`_asyncio.AsyncResult.one_or_none` except that
:class:`_engine.RowMapping` values, rather than :class:`_engine.Row`
objects, are returned.

TFNr   r,   s    r.   r   AsyncMappingResult.one_or_none  r   r   c                N   #    [        U R                  SSS5      I Sh  vN $  N7f)zReturn exactly one object or raise an exception.

Equivalent to :meth:`_asyncio.AsyncResult.one` except that
:class:`_engine.RowMapping` values, rather than :class:`_engine.Row`
objects, are returned.

TFNr   r,   s    r.   r   AsyncMappingResult.one  r   r   )r)   r(   rE   )r   r'   r   r   r   )re   r   r4   z#AsyncIterator[Sequence[RowMapping]])r4   Sequence[RowMapping])r4   zOptional[RowMapping])re   r   r4   r  r   )r4   r   )r7   r8   r9   r:   r   r;   r   r   
attrgetterrG   rK   rX   r_   rh   rn   rv   r|   r   r   r   r   r   r   r>   r&   r3   r.   r   r   k  s     IN&11*=9 15- 
4
 %)!	,(3
  %)F!F	F	3MLKr3   r   c                  J   \ rS rSrSrSr\(       a   S   SS jjrSS jrSS jr	SSS jjr
SS	 jrSS
 jrSS jrSS jrSS jrSS jr\SS j5       r\S S j5       rS S jr\    S!S j5       r\S"S j5       rS"S jr\    S!S j5       r\S S j5       rS S jrSrgSrg)#AsyncTupleResulti   a  A :class:`_asyncio.AsyncResult` that's typed as returning plain
Python tuples instead of rows.

Since :class:`_engine.Row` acts like a tuple in every way already,
this class is a typing only class, regular :class:`_asyncio.AsyncResult` is
still used at runtime.

r&   Nc                   #    g7f)zIterate through sub-lists of elements of the size given.

Equivalent to :meth:`_result.Result.partitions` except that
tuple values, rather than :class:`_engine.Row` objects,
are returned.

Nr&   r{   s     r.   rh   AsyncTupleResult.partitions  s
      r   c                   #    g7f)zFetch one tuple.

Equivalent to :meth:`_result.Result.fetchone` except that
tuple values, rather than :class:`_engine.Row`
objects, are returned.

Nr&   r,   s    r.   rv   AsyncTupleResult.fetchone  
      r   c                   #    g7f)z:A synonym for the :meth:`_engine.ScalarResult.all` method.Nr&   r,   s    r.   rn   AsyncTupleResult.fetchall$  s     r   c                   #    g7f)zFetch many objects.

Equivalent to :meth:`_result.Result.fetchmany` except that
tuple values, rather than :class:`_engine.Row` objects,
are returned.

Nr&   r{   s     r.   r|   AsyncTupleResult.fetchmany(  r  r   c                   #    g7f)zReturn all scalar values in a list.

Equivalent to :meth:`_result.Result.all` except that
tuple values, rather than :class:`_engine.Row` objects,
are returned.

Nr&   r,   s    r.   r   AsyncTupleResult.all2  r  r   c                   #    g 7fr   r&   r,   s    r.   r   AsyncTupleResult.__aiter__<  s     r   c                   #    g 7fr   r&   r,   s    r.   r   AsyncTupleResult.__anext__>  s     r   c                   #    g7f)zFetch the first object or ``None`` if no object is present.

Equivalent to :meth:`_result.Result.first` except that
tuple values, rather than :class:`_engine.Row` objects,
are returned.


Nr&   r,   s    r.   r   AsyncTupleResult.first@  s
      r   c                   #    g7f)zReturn at most one object or raise an exception.

Equivalent to :meth:`_result.Result.one_or_none` except that
tuple values, rather than :class:`_engine.Row` objects,
are returned.

Nr&   r,   s    r.   r   AsyncTupleResult.one_or_noneK  r  r   c                   #    g7f)zReturn exactly one object or raise an exception.

Equivalent to :meth:`_result.Result.one` except that
tuple values, rather than :class:`_engine.Row` objects,
are returned.

Nr&   r,   s    r.   r   AsyncTupleResult.oneU  r  r   c                   #    g 7fr   r&   r,   s    r.   r   AsyncTupleResult.scalar_one_  s     GJr   c                   #    g 7fr   r&   r,   s    r.   r   r%  b  s     +.r   c                   #    g7f)a  Return exactly one scalar result or raise an exception.

This is equivalent to calling :meth:`_engine.Result.scalars`
and then :meth:`_engine.AsyncScalarResult.one`.

.. seealso::

    :meth:`_engine.AsyncScalarResult.one`

    :meth:`_engine.Result.scalars`

Nr&   r,   s    r.   r   r%  e  
      r   c                   #    g 7fr   r&   r,   s    r.   r   #AsyncTupleResult.scalar_one_or_nonet  
      r   c                   #    g 7fr   r&   r,   s    r.   r   r*  y  s     =@r   c                   #    g7f)a  Return exactly one or no scalar result.

This is equivalent to calling :meth:`_engine.Result.scalars`
and then :meth:`_engine.AsyncScalarResult.one_or_none`.

.. seealso::

    :meth:`_engine.AsyncScalarResult.one_or_none`

    :meth:`_engine.Result.scalars`

Nr&   r,   s    r.   r   r*  |  r(  r   c                   #    g 7fr   r&   r,   s    r.   r   AsyncTupleResult.scalar  r+  r   c                   #    g 7fr   r&   r,   s    r.   r   r/    r   r   c                   #    g7f)aw  Fetch the first column of the first row, and close the result
set.

Returns ``None`` if there are no rows to fetch.

No validation is performed to test if additional rows remain.

After calling this method, the object is fully closed,
e.g. the :meth:`_engine.CursorResult.close`
method will have been called.

:return: a Python scalar value , or ``None`` if no rows remain.

Nr&   r,   s    r.   r   r/    s
      r   r   r   r   r   r   )r4   zAsyncIterator[_R]r   )r-   AsyncTupleResult[Tuple[_T]]r4   r    r   )r-   r2  r4   r   r   )r7   r8   r9   r:   r   r;   r
   rh   rv   rn   r|   r   r   r   r   r   r   r   r   r   r   r>   r&   r3   r.   r  r     s     I )-
	%
	(
					 	<,				 
J 
J	. 
.	 
	-		 
	 
@ 
@	 
	-		 
	 
* 
*	O r3   r  _RTr'   c           	       #     U R                   nU(       d  [        U SS 5      nOU nU(       a  UR                  R                  (       a  [        UR                  5      I S h  vN   [        R                  " SUR                  R                  R                  < SUR                  < SUR                  R                  R                  < S35      eU $ ! [         a    U s $ f = f N7f)NrawzCan't use the .z-() method with a server-side cursor. Use the z3.stream() method for an async streaming result set.)
_is_cursorAttributeErrorgetattrcontext_is_server_sider   r+   	async_excAsyncMethodRequired__self__	__class__r7   )r   calling_method	is_cursorcursor_results       r.   _ensure_sync_resultrC    s     %%	
 t4..>>]00111++ ''11::''''11::

 
	
 M+   	2s5   C%C AC%!C#"A/C%C C%C  C%)r   r3  r@  r   r4   r3  )0
__future__r   r   typingr   r   r   r   r   r	   r
   r    r   r<  r   enginer   engine.resultr   r   r   r   r   r   
engine.rowr   r   sql.baser   util.concurrencyr   util.typingr   r   r   r   r   r    r"   r$   r@   r   r   
TypingOnlyr  r3  rC  r&   r3   r.   <module>rN     s   #               $  & ) ) +  $ # . " &.2Te5c?+(,r" (,e5)[S2 e5P~KB ~KBRKK
$; RKjb{2 bJ e=)r3   