o
    -˜Žj”  ã                   @   sR   d dl Z d dlmZmZ d dlmZmZmZmZ er ddl	m
Z
 G dd„ dƒZdS )é    N)ÚAsyncIteratorÚIterable)ÚAnyÚCallableÚOptionalÚTYPE_CHECKINGé   )Ú
Connectionc                   @   sÎ  e Zd Zdddejddfdd„Zdeej fdd	„Zd
d„ Z	dd„ Z
	d5dedeee  dd fdd„Zdedeee  dd fdd„Zdedd fdd„Zdeej fdd„Zd5dee deej fdd„Zdeej fdd„Zd6dd„Zedefd d!„ƒZedee fd"d#„ƒZedefd$d%„ƒZejd&eddfd'd%„ƒZedeeeddddddf d(f fd)d*„ƒZedeeejejgef  fd+d,„ƒZ e jd-ee! ddfd.d,„ƒZ edej"fd/d0„ƒZ#d1d2„ Z$d3d4„ Z%dS )7ÚCursorÚconnr	   ÚcursorÚreturnNc                 C   s   |j | _|| _|| _d S ©N)Ú_iter_chunk_sizeÚiter_chunk_sizeÚ_connÚ_cursor)Úselfr   r   © r   úM/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/aiosqlite/cursor.pyÚ__init__   s   
zCursor.__init__c                 C   s   |   ¡ S )z+The cursor proxy is also an async iterator.)Ú_fetch_chunked©r   r   r   r   Ú	__aiter__   ó   zCursor.__aiter__c                 C  s0   �	 |   | j¡I d H }|sd S |D ]}|V  qqr   )Ú	fetchmanyr   )r   ÚrowsÚrowr   r   r   r      s   €ûzCursor._fetch_chunkedc                 Ï   s"   �| j j|g|¢R i |¤ŽI dH S )z=Execute the given function on the shared connection's thread.N)r   Ú_execute)r   ÚfnÚargsÚkwargsr   r   r   r      s   € zCursor._executeÚsqlÚ
parametersc                 Ã   s*   �|du rg }|   | jj||¡I dH  | S )zExecute the given query.N)r   r   Úexecute©r   r"   r#   r   r   r   r$   "   s
   €zCursor.executec                 Ã   s   �|   | jj||¡I dH  | S )zExecute the given multiquery.N)r   r   Úexecutemanyr%   r   r   r   r&   +   s   €zCursor.executemanyÚ
sql_scriptc                 Ã   s   �|   | jj|¡I dH  | S )zExecute a user script.N)r   r   Úexecutescript)r   r'   r   r   r   r(   2   s   €zCursor.executescriptc                 Ã   ó   �|   | jj¡I dH S )zFetch a single row.N)r   r   Úfetchoner   r   r   r   r*   7   ó   €zCursor.fetchoneÚsizec                 Ã   s0   �d}|dur
|f}| j | jjg|¢R Ž I dH S )z.Fetch up to `cursor.arraysize` number of rows.r   N)r   r   r   )r   r,   r    r   r   r   r   ;   s
   €zCursor.fetchmanyc                 Ã   r)   )zFetch all remaining rows.N)r   r   Úfetchallr   r   r   r   r-   B   r+   zCursor.fetchallc                 Ã   s   �|   | jj¡I dH  dS )zClose the cursor.N)r   r   Úcloser   r   r   r   r.   F   s   €zCursor.closec                 C   ó   | j jS r   )r   Úrowcountr   r   r   r   r0   J   r   zCursor.rowcountc                 C   r/   r   )r   Ú	lastrowidr   r   r   r   r1   N   r   zCursor.lastrowidc                 C   r/   r   ©r   Ú	arraysizer   r   r   r   r3   R   r   zCursor.arraysizeÚvaluec                 C   ó   || j _d S r   r2   )r   r4   r   r   r   r3   V   ó   .c                 C   r/   r   )r   Údescriptionr   r   r   r   r7   Z   r   zCursor.descriptionc                 C   r/   r   ©r   Úrow_factoryr   r   r   r   r9   ^   r   zCursor.row_factoryÚfactoryc                 C   r5   r   r8   )r   r:   r   r   r   r9   b   r6   c                 C   r/   r   )r   Ú
connectionr   r   r   r   r;   f   r   zCursor.connectionc                 Ã   s   �| S r   r   r   r   r   r   Ú
__aenter__j   s   €zCursor.__aenter__c                 Ã   s   �|   ¡ I d H  d S r   )r.   )r   Úexc_typeÚexc_valÚexc_tbr   r   r   Ú	__aexit__m   s   €zCursor.__aexit__r   )r   N)&Ú__name__Ú
__module__Ú__qualname__Úsqlite3r
   r   r   ÚRowr   r   r   Ústrr   r   r   r$   r&   r(   r*   Úintr   r-   r.   Úpropertyr0   r1   r3   ÚsetterÚtupler7   r   Úobjectr9   Útyper	   r;   r<   r@   r   r   r   r   r
      sV    ÿÿ
ÿ
þ	ÿ
ÿ
þ
*$r
   )rD   Úcollections.abcr   r   Útypingr   r   r   r   Úcorer	   r
   r   r   r   r   Ú<module>   s   