
    ,h                        S r 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
5      r
 " S S\
5      r " S S\5      r " S S\5      rg)z?generic asyncio-adapted versions of DBAPI connection and cursor    )annotationsN   )AdaptedConnection)asyncio)await_fallback)
await_onlyc                      \ rS rSrSrSrS rS r\S 5       r	\S 5       r
\S 5       r\R                  S	 5       r\S
 5       rS rSS jrS rS rS rS rS rS rS rSS jrS rSrg)AsyncAdapt_dbapi_cursor   F)_adapt_connection_connectionawait__cursor_rowsc                   Xl         UR                  U l        UR                  U l        U R                  R                  5       nU R	                  U5      U l        U R                  (       d  [        R                  " 5       U l	        g g N)
r   r   r   cursor_aenter_cursorr   server_sidecollectionsdequer   selfadapt_connectionr   s      U/var/www/auris/envauris/lib/python3.13/site-packages/sqlalchemy/connectors/asyncio.py__init__ AsyncAdapt_dbapi_cursor.__init__   sg    !1+77&--!!((***62$**,DJ      c                @    U R                  UR                  5       5      $ r   )r   
__aenter__)r   r   s     r   r   &AsyncAdapt_dbapi_cursor._aenter_cursor*   s    {{6,,.//r   c                .    U R                   R                  $ r   )r   descriptionr   s    r   r#   #AsyncAdapt_dbapi_cursor.description-   s    ||'''r   c                .    U R                   R                  $ r   )r   rowcountr$   s    r   r'    AsyncAdapt_dbapi_cursor.rowcount1   s    ||$$$r   c                .    U R                   R                  $ r   r   	arraysizer$   s    r   r+   !AsyncAdapt_dbapi_cursor.arraysize5       ||%%%r   c                $    XR                   l        g r   r*   r   values     r   r+   r,   9   s    !&r   c                .    U R                   R                  $ r   )r   	lastrowidr$   s    r   r2   !AsyncAdapt_dbapi_cursor.lastrowid=   r-   r   c                8    U R                   R                  5         g r   )r   clearr$   s    r   closeAsyncAdapt_dbapi_cursor.closeA   s     	

r   Nc                B    U R                  U R                  X5      5      $ r   )r   _execute_async)r   	operation
parameterss      r   executeAsyncAdapt_dbapi_cursor.executeF   s    {{4..yEFFr   c                B    U R                  U R                  X5      5      $ r   )r   _executemany_asyncr   r:   seq_of_parameterss      r   executemany#AsyncAdapt_dbapi_cursor.executemanyI   s!    {{##IA
 	
r   c                  #    U R                   R                   IS h  vN   U R                  R                  X=(       d    S5      I S h  vN nU R                  R                  (       aL  U R
                  (       d;  [        R                  " U R                  R                  5       I S h  vN 5      U l	        UsS S S 5      IS h  vN   $  N N N$ N! , IS h  vN  (       d  f       g = f7f)N )
r   _execute_mutexr   r<   r#   r   r   r   fetchallr   )r   r:   r;   results       r   r9   &AsyncAdapt_dbapi_cursor._execute_asyncN   s     ))888<<//	;KLLF||''0@0@(..T\\5J5J5L/LM
 988L 0M	 9888si   C*CC*(C	C

AC'C
(C6C*CC*
CCC*C'CC'#C*c                   #    U R                   R                   IS h  vN   U R                  R                  X5      I S h  vN sS S S 5      IS h  vN   $  N8 N N	! , IS h  vN  (       d  f       g = f7fr   )r   rF   r   rB   r@   s      r   r?   *AsyncAdapt_dbapi_cursor._executemany_asyncV   sH     ))88811)OO 988O 9888sV   A6AA6A AAA6AA6AA6A3"A%#A3/A6c                6   U R                  U R                  R                  5       5        U R                  R                  (       aU  U R                  (       dC  [
        R                  " U R                  U R                  R                  5       5      5      U l        g g g r   )	r   r   nextsetr#   r   r   r   rG   r   r$   s    r   rM   AsyncAdapt_dbapi_cursor.nextsetZ   sc    DLL((*+<<##D,<,<$**DLL1134DJ -=#r   c                R    U R                  U R                  R                  " U6 5      $ r   )r   r   setinputsizes)r   
inputsizess     r   rP   %AsyncAdapt_dbapi_cursor.setinputsizesa   s"    
 {{4<<55zBCCr   c              #     #    U R                   (       a0  U R                   R                  5       v   U R                   (       a  M/  g g 7fr   r   popleftr$   s    r   __iter__ AsyncAdapt_dbapi_cursor.__iter__h   s*     jj**$$&& jjjs   ?AAc                Z    U R                   (       a  U R                   R                  5       $ g r   rT   r$   s    r   fetchone AsyncAdapt_dbapi_cursor.fetchonel   s    ::::%%''r   c                    Uc  U R                   nU R                  n[        [        U[	        U5      5      5       Vs/ s H  o2R                  5       PM     sn$ s  snf r   )r+   r   rangeminlenrU   )r   sizerr_s       r   	fetchmany!AsyncAdapt_dbapi_cursor.fetchmanyr   sG    <>>DZZ&+Cc"g,>&?@&?

&?@@@s   Ac                d    [        U R                  5      nU R                  R                  5         U$ r   )listr   r5   )r   retvals     r   rG    AsyncAdapt_dbapi_cursor.fetchallx   s%    djj!

r   )r   r   r   r   r   r   )__name__
__module____qualname____firstlineno__r   	__slots__r   r   propertyr#   r'   r+   setterr2   r6   r<   rB   r9   r?   rM   rP   rV   rY   rb   rG   __static_attributes__rE   r   r   r
   r
      s    KI	-0 ( ( % % & & ' ' & &
G

PD'Ar   r
   c                  D    \ rS rSrSrSrS rS rS rSS jr	S	 r
S
 rSrg)AsyncAdapt_dbapi_ss_cursor~   rE   Tc                    Xl         UR                  U l        UR                  U l        U R                  R                  5       nU R                  UR	                  5       5      U l        g r   )r   r   r   r   r    r   r   s      r   r   #AsyncAdapt_dbapi_ss_cursor.__init__   sP    !1+77&--!!((*{{6#4#4#67r   c                    U R                   b1  U R                  U R                   R                  5       5        S U l         g g r   )r   r   r6   r$   s    r   r6    AsyncAdapt_dbapi_ss_cursor.close   s1    <<#KK**,-DL $r   c                T    U R                  U R                  R                  5       5      $ r   )r   r   rY   r$   s    r   rY   #AsyncAdapt_dbapi_ss_cursor.fetchone       {{4<<00233r   Nc                R    U R                  U R                  R                  US95      $ )N)r_   )r   r   rb   )r   r_   s     r   rb   $AsyncAdapt_dbapi_ss_cursor.fetchmany   s#    {{4<<11t1<==r   c                T    U R                  U R                  R                  5       5      $ r   )r   r   rG   r$   s    r   rG   #AsyncAdapt_dbapi_ss_cursor.fetchall   ry   r   c              #     #    U R                   R                  5       n  U R                  UR                  5       5      v   M$  ! [         a     g f = f7fr   )r   	__aiter__r   	__anext__StopAsyncIteration)r   iterators     r   rV   #AsyncAdapt_dbapi_ss_cursor.__iter__   sO     <<))+kk("4"4"677  & s(   A!A  A
AAAA)r   r   r   r   r   )rh   ri   rj   rk   rl   r   r   r6   rY   rb   rG   rV   ro   rE   r   r   rq   rq   ~   s*    IK8 
4>4r   rq   c                      \ rS rSr\r\r\" \	5      r
SrS rS rS rS r\S 5       r\R$                  S 5       rSS	 jrS
 rS rS rSrg)AsyncAdapt_dbapi_connection   )dbapirF   c                P    Xl         X l        [        R                  " 5       U l        g r   )r   r   r   LockrF   )r   r   
connections      r   r   $AsyncAdapt_dbapi_connection.__init__   s    
%%llnr   c                V    U R                  U R                  R                  U5      5      $ r   )r   r   ping)r   	reconnects     r   r    AsyncAdapt_dbapi_connection.ping   s"    {{4++00;<<r   c                <    U R                   R                  " U0 UD6  g r   )r   add_output_converter)r   argkws      r   r   0AsyncAdapt_dbapi_connection.add_output_converter   s    --s9b9r   c                6    U R                   R                  5       $ r   )r   character_set_namer$   s    r   r   .AsyncAdapt_dbapi_connection.character_set_name   s    2244r   c                .    U R                   R                  $ r   )r   
autocommitr$   s    r   r   &AsyncAdapt_dbapi_connection.autocommit   s    ***r   c                8    XR                   R                  l        g r   )r   _connr   r/   s     r   r   r      s    
 -2)r   c                T    U(       a  U R                  U 5      $ U R                  U 5      $ r   )_ss_cursor_cls_cursor_cls)r   r   s     r   r   "AsyncAdapt_dbapi_connection.cursor   s'    &&t,,##D))r   c                V    U R                  U R                  R                  5       5        g r   )r   r   rollbackr$   s    r   r   $AsyncAdapt_dbapi_connection.rollback   s    D$$--/0r   c                V    U R                  U R                  R                  5       5        g r   )r   r   commitr$   s    r   r   "AsyncAdapt_dbapi_connection.commit   s    D$$++-.r   c                V    U R                  U R                  R                  5       5        g r   )r   r   r6   r$   s    r   r6   !AsyncAdapt_dbapi_connection.close   s    D$$**,-r   )r   rF   r   N)F)rh   ri   rj   rk   r
   r   rq   r   staticmethodr   r   rl   r   r   r   r   rm   r   rn   r   r   r   r6   ro   rE   r   r   r   r      sq    )K/N*%F+I-
=:5 + + 2 2*1/.r   r   c                  (    \ rS rSrSr\" \5      rSrg)#AsyncAdaptFallback_dbapi_connection   rE   N)	rh   ri   rj   rk   rl   r   r   r   ro   rE   r   r   r   r      s    I.)Fr   r   )__doc__
__future__r   r   enginer   util.concurrencyr   r   r   r
   rq   r   r   rE   r   r   <module>r      sS    F "  & & - )f fR!!8 !H-."3 -.`**E *r   