
    gi                       d 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 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 erddlmZ ddlmZ ddlmZ  G d de          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# G d de!def         ee                   Z$ G d de!def         ee                   Z%d S )!z
psycopg raw queries cursors
    )annotations)TYPE_CHECKING   )ConnectionTypeParamsQuery)
Composable)Row)PyFormat)Cursor)PostgresQuery)
BaseCursor)AsyncCursor)ServerCursor)AsyncServerCursor)Any)
Connection)AsyncConnectionc                      e Zd Zd
dZddZd	S )PostgresRawQueryqueryr   varsParams | NonereturnNonec                   t          |t                    r|                    | j                  }n2t          |t                    r|                    | j                  }n|}|| _        d x| _        | _	        | 
                    |           d S )N)
isinstancestrencode	_encodingr	   as_bytes_txr   _want_formats_orderdump)selfr   r   bquerys       b/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/psycopg/raw_cursor.pyconvertzPostgresRawQuery.convert   s~    eS!! 	\\$.11FFz** 	^^DH--FFF
+//T[		$    c                T   |t          j        |          st          d          t          j        gt          |          z  | _        | j                            || j                  | _	        | j        j
        pd| _
        | j        j        | _        d S d | _	        d| _
        d | _        d S )Nz,raw queries require a sequence of parameters )r   is_params_sequence	TypeErrorr   AUTOlenr#   r"   dump_sequenceparamstypesformats)r&   r   s     r(   r%   zPostgresRawQuery.dump*   s     3D99 P NOOO"*-3t99!<D(00t7IJJDK-2DJ8+DLLLDKDJDLLLr*   N)r   r   r   r   r   r   )r   r   r   r   )__name__
__module____qualname__r)   r%   r,   r*   r(   r   r      s<        
 
 
 
           r*   r   c                      e Zd ZeZdS )RawCursorMixinN)r5   r6   r7   r   
_query_clsr,   r*   r(   r9   r9   9   s        !JJJr*   r9   c                      e Zd ZdZdS )	RawCursorpsycopgNr5   r6   r7   r,   r*   r(   r<   r<   =           JJJr*   r<   zConnection[Any]c                      e Zd ZdZdS )AsyncRawCursorr=   Nr>   r,   r*   r(   rA   rA   A   r?   r*   rA   zAsyncConnection[Any]c                      e Zd ZdZdS )RawServerCursorr=   Nr>   r,   r*   r(   rC   rC   E   r?   r*   rC   c                      e Zd ZdZdS )AsyncRawServerCursorr=   Nr>   r,   r*   r(   rE   rE   I   s         JJJr*   rE   N)&__doc__
__future__r   typingr   abcr   r   r   sqlr	   rowsr
   _enumsr   cursorr   _queriesr   _cursor_baser   cursor_asyncr   _server_cursorr   _server_cursor_asyncr   r   
connectionr   connection_asyncr   r   r9   r<   rA   rC   rE   r,   r*   r(   <module>rU      s    # " " " " "             . . . . . . . . . .                         # # # # # # $ $ $ $ $ $ % % % % % % ( ( ( ( ( ( 3 3 3 3 3 3 2&&&&&&111111         }      8" " " " "Z 34 " " "    0#56s       ^$:C$?@+cBR       n%6%;<l3>O       )3./1B31G    r*   