
    giy
                       d Z ddlmZ ddlmZ ddl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 ddlmZmZ ddl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
    )annotations)TYPE_CHECKING)partial   )adapt)errors)pq)ConnectionTypeParamsQuery)Row)Cursor)PostgresClientQueryPostgresQuery)Prepare)
BaseCursor)AsyncCursor)Any)
Connection)AsyncConnectionc                  8    e Zd ZeZdddZd	dd
ddZ	 dddZdS )ClientCursorMixinNqueryr   paramsParams | Nonereturnstrc                    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       e/var/www/html/Pagina-Ingenieria-Requisitos/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)   boolr*   bool | NoneNonec                  || 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_send0   s     >+CC",&&C&==%B   : 	1 J .556TJJ      	1L**5;===== L##EK00000r(   r%   preparetuple[Prepare, bytes]c                    t           j        dfS )Nr(   )r   NO)r$   r%   r>   s      r&   _get_preparedzClientCursorMixin._get_preparedP   s     
C  r(   )N)r   r   r   r   r   r   )r   r   r)   r+   r*   r,   r   r-   )r%   r   r>   r,   r   r?   )__name__
__module____qualname__r   
_query_clsr'   r=   rB    r(   r&   r   r   !   sw        $J
3 
3 
3 
3 
3   %"1 1 1 1 1 1B :>! ! ! ! ! ! !r(   r   c                      e Zd ZdZdS )ClientCursorpsycopgNrC   rD   rE   rG   r(   r&   rI   rI   V   s        JJJr(   rI   zConnection[Any]c                      e Zd ZdZdS )AsyncClientCursorrJ   NrK   rG   r(   r&   rM   rM   Z   s         JJJr(   rM   zAsyncConnection[Any]N)(__doc__
__future__r   typingr   	functoolsr    r   r   r2   r	   abcr
   r   r   rowsr   cursorr   _queriesr   r   
_preparingr   _cursor_baser   cursor_asyncr   r   
connectionr   connection_asyncr   Formatr1   r0   r   rI   rM   rG   r(   r&   <module>r]      s    # " " " " "                                     . . . . . . . . . .             8 8 8 8 8 8 8 8       $ $ $ $ $ $ % % % % % % 2&&&&&&111111	y~		2! 2! 2! 2! 2!
>3#67 2! 2! 2!j    $%6%;<fSk       ,c12K4D    r(   