
    *Jf
                        d Z ddlmZmZmZ ddlmZ ddlmZm	Z	 ddl
mZ ddl
mZ ddl
mZ dd	lmZmZmZ dd
lmZ ddlmZmZ ddlmZ ddlmZ erddlmZ ddlmZ ddlm Z  ej!        j"        Z"ej!        j#        Z# G d deeef                   Z$ G d de$def         ee                   Z% G d de$def         ee                   Z&dS )z%
psycopg client-side binding cursors
    )OptionalTupleTYPE_CHECKING)partial   )PostgresQueryPostgresClientQuery)pq)adapt)errors)ConnectionTypeQueryParams)Row)
BaseCursorCursor)Prepare)AsyncCursor)Any)
Connection)AsyncConnectionc            	           e Zd Zddedee         defdZddddede	d	ee	         ddfd
Z
	 ddedee         defdZ	 ddedee	         deeef         fdZdS )ClientCursorMixinNqueryparamsreturnc                     t          j        |           | _        |                     ||          }|j                            | j        j                  S )z
        Return the query and parameters merged.

        Parameters are adapted and merged to the query the same way that
        `!execute()` would do.

        )r   Transformer_tx_convert_queryr   decodeencodingselfr   r   pgqs       X/home/alex/cs2snipeproduction/venv/lib/python3.11/site-packages/psycopg/client_cursor.pymogrifyzClientCursorMixin.mogrify   sF     $T**!!%00y 1222    F)force_extendedbinaryr)   r*   c                   || j         }n|rt          nt          }|t          k    rt          j        d          || _        | j        j        rD| j        j        j        	                    t          | j        j        |j        d                      d S |r"| j                            |j        d            d S | j                            |j                   d S )Nz0client-side cursors don't support binary results)formatBINARYTEXTeNotSupportedError_query_conn	_pipelinecommand_queueappendr   _pgconnsend_query_paramsr   
send_query)r$   r   r)   r*   fmts        r&   _execute_sendzClientCursorMixin._execute_send+   s     >+CC",&&C&==%B   : 	1 J .556TJJ      	1L**5;===== L##EK00000r(   c                 Z    t          | j                  }|                    ||           |S N)r	   r   convertr#   s       r&   r    z ClientCursorMixin._convert_queryK   s,     "$(++E6"""
r(   r%   preparec                     t           j        dfS )Nr(   )r   NO)r$   r%   r>   s      r&   _get_preparedzClientCursorMixin._get_preparedR   s     
C  r(   r<   )__name__
__module____qualname__r   r   r   strr'   r   boolr:   r    r   r   bytesrA    r(   r&   r   r      s       
3 
3U 
3HV,< 
3 
3 
3 
3 
3   %!%1 1 11 	1
 1 
1 1 1 1B 8< $,V$4	    =A! ! !+3D>!	w~	! ! ! ! ! !r(   r   c                       e Zd ZdZdS )ClientCursorpsycopgNrB   rC   rD   rH   r(   r&   rJ   rJ   X   s        JJJr(   rJ   zConnection[Any]c                       e Zd ZdZdS )AsyncClientCursorrK   NrL   rH   r(   r&   rN   rN   \   s         JJJr(   rN   zAsyncConnection[Any]N)'__doc__typingr   r   r   	functoolsr   _queriesr   r	    r
   r   r   r/   abcr   r   r   rowsr   cursorr   r   
_preparingr   cursor_asyncr   r   
connectionr   connection_asyncr   Formatr.   r-   r   rJ   rN   rH   r(   r&   <module>r\      s    2 1 1 1 1 1 1 1 1 1       8 8 8 8 8 8 8 8                   . . . . . . . . . .       & & & & & & & &       % % % % % % 2&&&&&&111111	y~		7! 7! 7! 7! 7!
>3#67 7! 7! 7!t    $%6%;<fSk       ,c12K4D    r(   