
    gi                    @   U d Z ddlmZ ddlmZmZmZmZ ddlmZm	Z	m
Z
mZmZ ddlmZ ddlmZ ddlmZmZmZ er(dd	lmZ dd
l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"d          Z#de$d<   ee%e&e'f         Z(de$d<   eee%ddf         Z)de$d<   eee         e	e*ef         f         Z+de$d<    edd          Z,eg df         Z-de$d<   ee"df         Z.de$d<   ee*e/df         Z0de$d<   ee*e0f         Z1de$d<   e	e*e0f         Z2de$d <    ed!          Z3ed"d#e3f         Z4de$d$<   	 ed%d#e3f         Z5de$d&<   	  G d' d(e
          Z6eegd)f         Z7de$d*<   ee(gef         Z8de$d+<    G d, d-e
          Z9 G d. d/e
          Z: G d0 d1e
          Z; G d2 d3e
          Z<dS )4zN
Protocol objects representing different implementations of the same classes.
    )annotations)TYPE_CHECKINGAnyCallableDict)	GeneratorMappingProtocolSequenceUnion   )pq)PyFormat)LiteralString	TypeAliasTypeVar)sql)RowRowMaker)PGresult)ReadyWait)AdaptersMap)BaseConnectionNtypeNoneTyper   Bufferzsql.SQLzsql.ComposedQueryParamsConnectionTypezBaseConnection[Any])boundPipelineCommandztuple[DumperKey, ...]	DumperKey	ConnParamConnDictConnMappingRVztuple[int, Wait]zReady | int	PQGenConnr   PQGenc                      e Zd ZdZdddZdS )WaitFunczU
    Wait on the connection which generated `PQgen` and return its final result.
    .gen	PQGen[RV]filenointintervalfloatreturnr'   c                    d S N )selfr,   r.   r0   s       [/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/psycopg/abc.py__call__zWaitFunc.__call__;             N).)r,   r-   r.   r/   r0   r1   r2   r'   )__name__
__module____qualname____doc__r8   r5   r:   r7   r+   r+   6   s,          VUUUUUUr:   r+   Buffer | NoneDumpFuncLoadFuncc                  B    e Zd ZdZedd            Zed	d            ZdS )
AdaptContextaO  
    A context describing how types are adapted.

    Example of `~AdaptContext` are `~psycopg.Connection`, `~psycopg.Cursor`,
    `~psycopg.adapt.Transformer`, `~psycopg.adapt.AdaptersMap`.

    Note that this is a `~typing.Protocol`, so objects implementing
    `!AdaptContext` don't need to explicitly inherit from this class.

    r2   r   c                    dS )z1The adapters configuration that this object uses.Nr5   r6   s    r7   adapterszAdaptContext.adaptersP   s	     	r:   BaseConnection[Any] | Nonec                    dS )zThe connection used by this object, if available.

        :rtype: `~psycopg.Connection` or `~psycopg.AsyncConnection` or `!None`
        Nr5   rE   s    r7   
connectionzAdaptContext.connectionU   	     	r:   Nr2   r   r2   rG   )r;   r<   r=   r>   propertyrF   rI   r5   r:   r7   rC   rC   D   s^        	 	    X    X  r:   rC   c                  V    e Zd ZU dZded<   	 ded<   	 dddZddZddZddZddZ	dS )DumperzM
    Convert Python objects of type `!cls` to PostgreSQL representation.
    	pq.Formatformatr/   oidNclsr   contextAdaptContext | Nonec                    d S r4   r5   )r6   rS   rT   s      r7   __init__zDumper.__init__n   r9   r:   objr   r2   r?   c                    dS )zlConvert the object `!obj` to PostgreSQL representation.

        :param obj: the object to convert.
        Nr5   r6   rX   s     r7   dumpzDumper.dumpp   	    
 	r:   r   c                    dS )ziConvert the object `!obj` to escaped representation.

        :param obj: the object to convert.
        Nr5   rZ   s     r7   quotezDumper.quotew   r\   r:   r   r#   c                    dS )a  Return an alternative key to upgrade the dumper to represent `!obj`.

        :param obj: The object to convert
        :param format: The format to convert to

        Normally the type of the object is all it takes to define how to dump
        the object to the database. For instance, a Python `~datetime.date` can
        be simply converted into a PostgreSQL :sql:`date`.

        In a few cases, just the type is not enough. For example:

        - A Python `~datetime.datetime` could be represented as a
          :sql:`timestamptz` or a :sql:`timestamp`, according to whether it
          specifies a `!tzinfo` or not.

        - A Python int could be stored as several Postgres types: int2, int4,
          int8, numeric. If a type too small is used, it may result in an
          overflow. If a type too large is used, PostgreSQL may not want to
          cast it to a smaller type.

        - Python lists should be dumped according to the type they contain to
          convert them to e.g. array of strings, array of ints (and which
          size of int?...)

        In these cases, a dumper can implement `!get_key()` and return a new
        class, or sequence of classes, that can be used to identify the same
        dumper again. If the mechanism is not needed, the method should return
        the same `!cls` object passed in the constructor.

        If a dumper implements `get_key()` it should also implement
        `upgrade()`.

        Nr5   r6   rX   rQ   s      r7   get_keyzDumper.get_key~   s
    D 	r:   c                    dS )a  Return a new dumper to manage `!obj`.

        :param obj: The object to convert
        :param format: The format to convert to

        Once `Transformer.get_dumper()` has been notified by `get_key()` that
        this Dumper class cannot handle `!obj` itself, it will invoke
        `!upgrade()`, which should return a new `Dumper` instance, which will
        be reused for every objects for which `!get_key()` returns the same
        result.
        Nr5   r`   s      r7   upgradezDumper.upgrade   s	     	r:   r4   )rS   r   rT   rU   )rX   r   r2   r?   )rX   r   r2   r   )rX   r   rQ   r   r2   r#   rX   r   rQ   r   r2   rO   )
r;   r<   r=   r>   __annotations__rW   r[   r^   ra   rc   r5   r:   r7   rO   rO   ^   s            HHHQKKKKK      " " " "H     r:   rO   c                  2    e Zd ZU dZded<   	 ddd	ZddZdS )LoaderzK
    Convert PostgreSQL values with type OID `!oid` to Python objects.
    rP   rQ   NrR   r/   rT   rU   c                    d S r4   r5   )r6   rR   rT   s      r7   rW   zLoader.__init__   r9   r:   datar   r2   r   c                    dS )z|
        Convert the data returned by the database into a Python object.

        :param data: the data to convert.
        Nr5   )r6   ri   s     r7   loadzLoader.load   rJ   r:   r4   )rR   r/   rT   rU   )ri   r   r2   r   )r;   r<   r=   r>   re   rW   rk   r5   r:   r7   rg   rg      sY            KJJJJ     r:   rg   c                      e Zd ZU ded<   ded<   d<d=dZed>d
            Zed?d            Zed@d            Z	edAd            Z
edBd            ZddddCdZdDdZdDdZdEd$ZdFd(ZdGd+ZdHd2ZdId5ZdJd8ZdKd;ZdS )LTransformerztuple[int, ...] | Nonetypeszlist[pq.Format] | NoneformatsNrT   rU   c                    d S r4   r5   )r6   rT   s     r7   rW   zTransformer.__init__   r9   r:   r2   c                    d S r4   r5   )rS   rT   s     r7   from_contextzTransformer.from_context   s    HKr:   rG   c                    d S r4   r5   rE   s    r7   rI   zTransformer.connection   s    8;r:   strc                    d S r4   r5   rE   s    r7   encodingzTransformer.encoding   s    "sr:   r   c                    d S r4   r5   rE   s    r7   rF   zTransformer.adapters   s    '*sr:   PGresult | Nonec                    d S r4   r5   rE   s    r7   pgresultzTransformer.pgresult   s    +.3r:   T)set_loadersrQ   resultr{   boolrQ   pq.Format | NoneNonec                   d S r4   r5   )r6   r|   r{   rQ   s       r7   set_pgresultzTransformer.set_pgresult   s	     sr:   Sequence[int]rP   c                    d S r4   r5   r6   rn   rQ   s      r7   set_dumper_typeszTransformer.set_dumper_types   r9   r:   c                    d S r4   r5   r   s      r7   set_loader_typeszTransformer.set_loader_types   r9   r:   paramsSequence[Any]Sequence[PyFormat]Sequence[Buffer | None]c                    d S r4   r5   )r6   r   ro   s      r7   dump_sequencezTransformer.dump_sequence   s    "%#r:   rX   r   bytesc                    d S r4   r5   rZ   s     r7   
as_literalzTransformer.as_literal   r9   r:   r   rO   c                    d S r4   r5   r`   s      r7   
get_dumperzTransformer.get_dumper   r9   r:   row0r/   row1make_rowRowMaker[Row]	list[Row]c                    d S r4   r5   )r6   r   r   r   s       r7   	load_rowszTransformer.load_rows   r9   r:   rowr   c                    d S r4   r5   )r6   r   r   s      r7   load_rowzTransformer.load_row   r9   r:   recordtuple[Any, ...]c                    d S r4   r5   )r6   r   s     r7   load_sequencezTransformer.load_sequence   r9   r:   rR   rg   c                    d S r4   r5   )r6   rR   rQ   s      r7   
get_loaderzTransformer.get_loader   r9   r:   r4   )rT   rU   )rT   rU   r2   rm   rL   )r2   rt   rK   )r2   rx   )r|   rx   r{   r}   rQ   r~   r2   r   )rn   r   rQ   rP   r2   r   )r   r   ro   r   r2   r   )rX   r   r2   r   rd   )r   r/   r   r/   r   r   r2   r   )r   r/   r   r   r2   r   )r   r   r2   r   )rR   r/   rQ   rP   r2   rg   )r;   r<   r=   re   rW   classmethodrr   rM   rI   rv   rF   rz   r   r   r   r   r   r   r   r   r   r   r5   r:   r7   rm   rm      sF        !!!!####@@@@@KKK [K;;; X;""" X"*** X*... X. !#'      UTTTTTTT& & & & 1000CCCCXXXXEEEETTTTDDDDDDr:   rm   )=r>   
__future__r   typingr   r   r   r   r   r	   r
   r   r    r   _enumsr   _compatr   r   r   r   rowsr   r   pq.abcr   waitingr   r   _adapters_mapr   _connection_baser   r   r   re   r   	bytearray
memoryviewr   r   rt   r   r    r"   r#   r/   r$   r%   r&   r'   r(   r)   r+   r@   rA   rC   rO   rg   rm   r5   r:   r7   <module>r      s     # " " " " " 5 5 5 5 5 5 5 5 5 5 5 5 @ @ @ @ @ @ @ @ @ @ @ @ @ @       ( ( ( ( ( ( 6 6 6 6 6 6 6 6 6 6 1########      $$$$$$$$******000000d     %J67 7 7 7 7y.HI I I I I(3-c)::; ; ; ; ;)1FGGG%b$h/ / / / /T#::;	 ; ; ; ;S#t^,	 , , , ,3	>* * * * * i0 0 0 0 0
 WT]] !3]B!FG	 G G G G
 V]B67 7 7 7 7V V V V Vx V V V uo56 6 6 6 6x}- - - - -    8   4P P P P PX P P Pf    X   0/E /E /E /E /E( /E /E /E /E /Er:   