
    (ph                    j   % S r SSKJr  SSKJrJrJrJr  SSKJrJ	r	J
r
  SSKJr  SSKJr  SSKJrJr  \
(       a.  SS	KJr  SS
KJrJr  SSKJr  SSKJrJr  SSKJr  SSKJr  SSKJr  \ " S5      r!S\"S'   Sr#S\"S'   Sr$S\"S'   Sr%S\"S'   \" SSS9r&\/ S4   r'S\"S'   Sr(S\"S'   S r)S\"S!'   S"r*S\"S#'   \\+\)4   r,S\"S$'   \" S%5      r-\S&S'\-4   r.S\"S('    \S)S'\-4   r/S\"S*'     " S+ S,\5      r0\\/S-4   r1S\"S.'   \\#/\4   r2S\"S/'    " S0 S1\5      r3 " S2 S3\5      r4 " S4 S5\5      r5 " S6 S7\5      r6g)8zN
Protocol objects representing different implementations of the same classes.
    )annotations)AnyCallable	GeneratorMapping)ProtocolSequenceTYPE_CHECKING   )pq)PyFormat)	TypeAliasTypeVar)sql)RowRowMaker)PGresult)WaitReady)LiteralString)AdaptersMap)BaseConnectionNtypeNoneTypezbytes | bytearray | memoryviewr   Bufferz.LiteralString | bytes | sql.SQL | sql.ComposedQueryz!Sequence[Any] | Mapping[str, Any]ParamsConnectionTypezBaseConnection[Any])boundPipelineCommandztype | tuple[DumperKey, ...]	DumperKeyzstr | int | None	ConnParamzdict[str, ConnParam]ConnDictConnMappingRVztuple[int, Wait]zReady | int	PQGenConnr   PQGenc                  6    \ rS rSrSr S       SS jjrSrg)WaitFunc7   zM
Wait on the connection which generated `PQgen` and return its final result.
Nc                    g N )selfgenfilenointervals       >/var/www/html/venv/lib/python3.13/site-packages/psycopg/abc.py__call__WaitFunc.__call__<   s        r-   r,   )r/   z	PQGen[RV]r0   intr1   zfloat | Nonereturnr%   )__name__
__module____qualname____firstlineno____doc__r3   __static_attributes__r-   r5   r2   r)   r)   7   s8    
 EI&)5A	 r5   r)   Buffer | NoneDumpFuncLoadFuncc                  @    \ rS rSrSr\SS j5       r\SS j5       rSrg)	AdaptContextG   a7  
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.

c                    g)z1The adapters configuration that this object uses.Nr-   r.   s    r2   adaptersAdaptContext.adaptersS   s     	r5   c                    g)zzThe connection used by this object, if available.

:rtype: `~psycopg.Connection` or `~psycopg.AsyncConnection` or `!None`
Nr-   rE   s    r2   
connectionAdaptContext.connectionX        	r5   r-   Nr7   r   r7   zBaseConnection[Any] | None)	r8   r9   r:   r;   r<   propertyrF   rI   r=   r-   r5   r2   rB   rB   G   s/    	    r5   rB   c                  h    \ rS rSr% SrS\S'    S\S'    SSS jjrSS	 jrSS
 jrSS jr	SS jr
Srg)Dumpera   zE
Convert Python objects of type `!cls` to PostgreSQL representation.
	pq.Formatformatr6   oidNc                    g r,   r-   )r.   clscontexts      r2   __init__Dumper.__init__q   s    r5   c                    g)z\Convert the object `!obj` to PostgreSQL representation.

:param obj: the object to convert.
Nr-   r.   objs     r2   dumpDumper.dumps       
 	r5   c                    g)zYConvert the object `!obj` to escaped representation.

:param obj: the object to convert.
Nr-   r[   s     r2   quoteDumper.quotez   r_   r5   c                    g)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()`.

Nr-   r.   r\   rS   s      r2   get_keyDumper.get_key   s    D 	r5   c                    g)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.
Nr-   rd   s      r2   upgradeDumper.upgrade   s     	r5   r-   r,   )rV   r   rW   AdaptContext | None)r\   r   r7   r>   )r\   r   r7   r   )r\   r   rS   r   r7   r!   r\   r   rS   r   r7   rP   )r8   r9   r:   r;   r<   __annotations__rX   r]   ra   re   rh   r=   r-   r5   r2   rP   rP   a   s6      
HQK"Hr5   rP   c                  >    \ rS rSr% SrS\S'    S	S
S jjrSS jrSrg)Loader   zC
Convert PostgreSQL values with type OID `!oid` to Python objects.
rR   rS   Nc                    g r,   r-   )r.   rT   rW   s      r2   rX   Loader.__init__   s    sr5   c                    g)zd
Convert the data returned by the database into a Python object.

:param data: the data to convert.
Nr-   )r.   datas     r2   loadLoader.load   rK   r5   r-   r,   )rT   r6   rW   rj   )rs   r   r7   r   )	r8   r9   r:   r;   r<   rl   rX   rt   r=   r-   r5   r2   rn   rn      s      Kr5   rn   c                  $   \ rS rSr% S\S'   S\S'   SSS jjr\SS j5       r\SS	 j5       r	\SS
 j5       r
\SS j5       r\S S j5       rSSS.       S!S jjrS"S jrS"S jr      S#S jrS$S jrS%S jrS&S jrS'S jrS(S jrS)S jrSrg)*Transformer   ztuple[int, ...] | Nonetypeszlist[pq.Format] | NoneformatsNc                    g r,   r-   )r.   rW   s     r2   rX   Transformer.__init__   s    Sr5   c                    g r,   r-   )rV   rW   s     r2   from_contextTransformer.from_context   s    HKr5   c                    g r,   r-   rE   s    r2   rI   Transformer.connection   s    8;r5   c                    g r,   r-   rE   s    r2   encodingTransformer.encoding   s    "r5   c                    g r,   r-   rE   s    r2   rF   Transformer.adapters   s    '*r5   c                    g r,   r-   rE   s    r2   pgresultTransformer.pgresult   s    +.r5   T)set_loadersrS   c                   g r,   r-   )r.   resultr   rS   s       r2   set_pgresultTransformer.set_pgresult   s     r5   c                    g r,   r-   r.   ry   rS   s      r2   set_dumper_typesTransformer.set_dumper_types       QTr5   c                    g r,   r-   r   s      r2   set_loader_typesTransformer.set_loader_types   r   r5   c                    g r,   r-   )r.   paramsrz   s      r2   dump_sequenceTransformer.dump_sequence   s    "%r5   c                    g r,   r-   r[   s     r2   
as_literalTransformer.as_literal   s    Sr5   c                    g r,   r-   rd   s      r2   
get_dumperTransformer.get_dumper   s    r5   c                    g r,   r-   )r.   row0row1make_rows       r2   	load_rowsTransformer.load_rows   s    UXr5   c                    g r,   r-   )r.   rowr   s      r2   load_rowTransformer.load_row   s    r5   c                    g r,   r-   )r.   records     r2   load_sequenceTransformer.load_sequence   r   r5   c                    g r,   r-   )r.   rT   rS   s      r2   
get_loaderTransformer.get_loader   s    r5   r-   r,   )rW   rj   )rW   rj   r7   rw   rM   )r7   strrL   )r7   PGresult | None)r   r   r   boolrS   zpq.Format | Noner7   None)ry   zSequence[int]rS   rR   r7   r   )r   zSequence[Any]rz   zSequence[PyFormat]r7   Sequence[Buffer | None])r\   r   r7   bytesrk   )r   r6   r   r6   r   RowMaker[Row]r7   z	list[Row])r   r6   r   r   r7   z
Row | None)r   r   r7   ztuple[Any, ...])rT   r6   rS   rR   r7   rn   )r8   r9   r:   r;   rl   rX   classmethodr~   rN   rI   r   rF   r   r   r   r   r   r   r   r   r   r   r   r=   r-   r5   r2   rw   rw      s    !!##@K K; ;" "* *. . !#' 	
 ! 
 UT&#&.@&	 & 1CXLTDr5   rw   )7r<   
__future__r   typingr   r   r   r   r   r	   r
    r   _enumsr   _compatr   r   r   rowsr   r   pq.abcr   waitingr   r   r   _adapters_mapr   _connection_baser   r   r   rl   r   r   r   r   r    r!   r"   r#   r   r$   r%   r&   r'   r)   r?   r@   rB   rP   rn   rw   r-   r5   r2   <module>r      sn   # 4 4 4 4  ( '# $&*0d$  5	 4Cy C7	 7)1FG%b$h/ /5	9 5)	9 ),) , i0Y 0
 T] !3]B!FG	9 G
 V]B67y 7x  uo56) 6x}-) -8 4PX PfX 0/E( /Er5   