
    ,h                       % 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
JrJr  SSKJr  SSKJr  SSKJr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5      r#S\$S'   \\%\&\'4   r(S\$S'   \\\%SS4   r)S\$S'   \\\   \	\*\4   4   r+S\$S'   \" SSS9r,\/ S4   r-S\$S'   \\"S4   r.S\$S'   \\*\/S4   r0S\$S'   \\*\04   r1S\$S'   \	\*\04   r2S\$S '   \" S!5      r3\S"S#\34   r4S\$S$'    \S%S#\34   r5S\$S&'     " S' S(\
5      r6\\/S)4   r7S\$S*'   \\(/\4   r8S\$S+'    " S, S-\
5      r9 " S. S/\
5      r: " S0 S1\
5      r; " S2 S3\
5      r<g)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                  6    \ rS rSrSr S       SS jjrSrg)WaitFunc6   zM
Wait on the connection which generated `PQgen` and return its final result.
Nc                    g N )selfgenfilenointervals       F/var/www/html/Ai_home/venv/lib/python3.13/site-packages/psycopg/abc.py__call__WaitFunc.__call__;   s        r/   r.   )r1   z	PQGen[RV]r2   intr3   zfloat | Nonereturnr'   )__name__
__module____qualname____firstlineno____doc__r5   __static_attributes__r/   r7   r4   r+   r+   6   s8    
 EI&)5A	 r7   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)	AdaptContextF   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/   r0   s    r4   adaptersAdaptContext.adaptersR   s     	r7   c                    g)zzThe connection used by this object, if available.

:rtype: `~psycopg.Connection` or `~psycopg.AsyncConnection` or `!None`
Nr/   rG   s    r4   
connectionAdaptContext.connectionW        	r7   r/   Nr9   r   r9   zBaseConnection[Any] | None)	r:   r;   r<   r=   r>   propertyrH   rK   r?   r/   r7   r4   rD   rD   F   s/    	    r7   rD   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)Dumper`   zE
Convert Python objects of type `!cls` to PostgreSQL representation.
	pq.Formatformatr8   oidNc                    g r.   r/   )r0   clscontexts      r4   __init__Dumper.__init__p   s    r7   c                    g)z\Convert the object `!obj` to PostgreSQL representation.

:param obj: the object to convert.
Nr/   r0   objs     r4   dumpDumper.dumpr       
 	r7   c                    g)zYConvert the object `!obj` to escaped representation.

:param obj: the object to convert.
Nr/   r]   s     r4   quoteDumper.quotey   ra   r7   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/   r0   r^   rU   s      r4   get_keyDumper.get_key   s    D 	r7   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/   rf   s      r4   upgradeDumper.upgrade   s     	r7   r/   r.   )rX   r   rY   AdaptContext | None)r^   r   r9   r@   )r^   r   r9   r   )r^   r   rU   r   r9   r#   r^   r   rU   r   r9   rR   )r:   r;   r<   r=   r>   __annotations__rZ   r_   rc   rg   rj   r?   r/   r7   r4   rR   rR   `   s6      
HQK"Hr7   rR   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.
rT   rU   Nc                    g r.   r/   )r0   rV   rY   s      r4   rZ   Loader.__init__   s    sr7   c                    g)zd
Convert the data returned by the database into a Python object.

:param data: the data to convert.
Nr/   )r0   datas     r4   loadLoader.load   rM   r7   r/   r.   )rV   r8   rY   rl   )ru   r   r9   r   )	r:   r;   r<   r=   r>   rn   rZ   rv   r?   r/   r7   r4   rp   rp      s      Kr7   rp   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/   )r0   rY   s     r4   rZ   Transformer.__init__   s    Sr7   c                    g r.   r/   )rX   rY   s     r4   from_contextTransformer.from_context   s    HKr7   c                    g r.   r/   rG   s    r4   rK   Transformer.connection   s    8;r7   c                    g r.   r/   rG   s    r4   encodingTransformer.encoding   s    "r7   c                    g r.   r/   rG   s    r4   rH   Transformer.adapters   s    '*r7   c                    g r.   r/   rG   s    r4   pgresultTransformer.pgresult   s    +.r7   T)set_loadersrU   c                   g r.   r/   )r0   resultr   rU   s       r4   set_pgresultTransformer.set_pgresult   s     r7   c                    g r.   r/   r0   r{   rU   s      r4   set_dumper_typesTransformer.set_dumper_types       QTr7   c                    g r.   r/   r   s      r4   set_loader_typesTransformer.set_loader_types   r   r7   c                    g r.   r/   )r0   paramsr|   s      r4   dump_sequenceTransformer.dump_sequence   s    "%r7   c                    g r.   r/   r]   s     r4   
as_literalTransformer.as_literal   s    Sr7   c                    g r.   r/   rf   s      r4   
get_dumperTransformer.get_dumper   s    r7   c                    g r.   r/   )r0   row0row1make_rows       r4   	load_rowsTransformer.load_rows   s    UXr7   c                    g r.   r/   )r0   rowr   s      r4   load_rowTransformer.load_row   s    #r7   c                    g r.   r/   )r0   records     r4   load_sequenceTransformer.load_sequence   r   r7   c                    g r.   r/   )r0   rV   rU   s      r4   
get_loaderTransformer.get_loader   s    r7   r/   r.   )rY   rl   )rY   rl   r9   ry   rO   )r9   strrN   )r9   PGresult | None)r   r   r   boolrU   zpq.Format | Noner9   None)r{   zSequence[int]rU   rT   r9   r   )r   zSequence[Any]r|   zSequence[PyFormat]r9   Sequence[Buffer | None])r^   r   r9   bytesrm   )r   r8   r   r8   r   RowMaker[Row]r9   z	list[Row])r   r8   r   r   r9   r   )r   r   r9   ztuple[Any, ...])rV   r8   rU   rT   r9   rp   )r:   r;   r<   r=   rn   rZ   classmethodr   rP   rK   r   rH   r   r   r   r   r   r   r   r   r   r   r   r?   r/   r7   r4   ry   ry      s    !!##@K K; ;" "* *. . !#' 	
 ! 
 UT&#&.@&	 & 1CXETDr7   ry   )=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   rn   r   	bytearray
memoryviewr   r   r   r   r    r"   r#   r8   r$   r%   r&   r'   r(   r)   r+   rA   rB   rD   rR   rp   ry   r/   r7   r4   <module>r      s   # 5 5 @ @  ( 6 6# $*0d$  %J67	 7y.HIy I(3-c)::;	 ;)1FG%b$h/ /T#::;	9 ;S#t^,	9 ,3	>*) * 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r7   