Ë
    ¼vëjZ  ã                  óè  — U d Z ddlmZ ddlmZmZmZmZmZ ddl	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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#e0d   f   Z1de%d<   ee,e2df   Z3de%d<   e4e,e3f   Z5de%d <   ee,e3f   Z6de%d!<    ed"«      Z7ee0e2d#f   d$e7f   Z8de%d%<   	 ed#d$e7f   Z9de%d&<   	  G d'„ d(e«      Z:e
ege)dz  f   Z;de%d)<   e
e)gef   Z<de%d*<    G d+„ d,e«      Z= G d-„ d.e«      Z> G d/„ d0e«      Z? G d1„ d2e«      Z@y)3zN
Protocol objects representing different implementations of the same classes.
é    )Úannotations)ÚTYPE_CHECKINGÚAnyÚProtocolÚ	TypeAliasÚUnion)ÚCallableÚ	GeneratorÚMappingÚSequenceé   )Úpq)ÚPyFormat)ÚLiteralStringÚTemplateÚTypeVar)Úsql)ÚRowÚRowMaker)ÚPGresult)ÚReadyÚWait)ÚAdaptersMap)ÚBaseConnectionNÚtypeÚNoneTyper   ÚBufferzsql.SQLzsql.ComposedÚQueryNoTemplateÚQueryÚParamsÚConnectionTypezBaseConnection[Any])ÚboundÚPipelineCommand)Ú	DumperKey.r$   Ú	ConnParamÚConnDictÚConnMappingÚRVr   zReady | intÚ	PQGenConnÚPQGenc                  ó0   — e Zd ZdZ	 	 d	 	 	 	 	 	 	 	 	 dd„Zy)ÚWaitFunczU
    Wait on the connection which generated `PQgen` and return its final result.
    c                 ó   — y ©N© )ÚselfÚgenÚfilenoÚintervalÚtimeouts        úL/var/www/html/strategist-ai/venv/lib/python3.12/site-packages/psycopg/abc.pyÚ__call__zWaitFunc.__call__<   s   € ð ó    N)..)
r1   z	PQGen[RV]r2   Úintr3   Úfloatr4   zfloat | NoneÚreturnr(   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r6   r/   r7   r5   r,   r,   7   sD   „ ñð Ø #ðàðð ðð ð	ð
 ðð 
ôr7   r,   ÚDumpFuncÚLoadFuncc                  ó4   — e Zd ZdZedd„«       Zedd„«       Zy)Ú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.

    c                 ó   — y)z1The adapters configuration that this object uses.Nr/   ©r0   s    r5   ÚadapterszAdaptContext.adaptersW   s   € ð 	r7   c                 ó   — y)zŠThe connection used by this object, if available.

        :rtype: `~psycopg.Connection` or `~psycopg.AsyncConnection` or `!None`
        Nr/   rD   s    r5   Ú
connectionzAdaptContext.connection\   ó   € ð 	r7   N©r:   r   ©r:   zBaseConnection[Any] | None)r;   r<   r=   r>   ÚpropertyrE   rG   r/   r7   r5   rB   rB   K   s/   „ ñ	ð òó ðð òó ñr7   rB   c                  óT   — 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	y)ÚDumperzM
    Convert Python objects of type `!cls` to PostgreSQL representation.
    ú	pq.FormatÚformatr8   ÚoidNc                 ó   — y r.   r/   )r0   ÚclsÚcontexts      r5   Ú__init__zDumper.__init__u   ó   � r7   c                 ó   — y)zlConvert the object `!obj` to PostgreSQL representation.

        :param obj: the object to convert.
        Nr/   ©r0   Úobjs     r5   ÚdumpzDumper.dumpw   ó   € ð
 	r7   c                 ó   — y)ziConvert the object `!obj` to escaped representation.

        :param obj: the object to convert.
        Nr/   rW   s     r5   ÚquotezDumper.quote~   rZ   r7   c                 ó   — y)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   rX   rO   s      r5   Úget_keyzDumper.get_key…   s   € ðD 	r7   c                 ó   — y)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/   r^   s      r5   ÚupgradezDumper.upgrade©   s   € ð 	r7   r.   )rR   r   rS   úAdaptContext | None)rX   r   r:   zBuffer | None)rX   r   r:   r   )rX   r   rO   r   r:   r$   ©rX   r   rO   r   r:   rM   )
r;   r<   r=   r>   Ú__annotations__rT   rY   r\   r_   ra   r/   r7   r5   rM   rM   e   s6   … ñð Óðð 
ƒHØQäKóóó"ôHr7   rM   c                  ó0   — e Zd ZU dZded<   	 ddd„Zd	d„Zy)
ÚLoaderzK
    Convert PostgreSQL values with type OID `!oid` to Python objects.
    rN   rO   Nc                 ó   — y r.   r/   )r0   rP   rS   s      r5   rT   zLoader.__init__Å   rU   r7   c                 ó   — y)z|
        Convert the data returned by the database into a Python object.

        :param data: the data to convert.
        Nr/   )r0   Údatas     r5   ÚloadzLoader.loadÇ   rH   r7   r.   )rP   r8   rS   rb   )ri   r   r:   r   )r;   r<   r=   r>   rd   rT   rj   r/   r7   r5   rf   rf   ¸   s   … ñð Óðô Kôr7   rf   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dd
„«       Z
edd„«       Zdddœ	 	 	 	 	 	 	 dd„Zd d„Zd d„Z	 	 	 	 	 	 d!d„Zd"d„Zd#d„Zd$d„Zd%d„Zd&d„Zd'd„Zy)(ÚTransformerztuple[int, ...] | NoneÚtypeszlist[pq.Format] | NoneÚformatsNc                 ó   — y r.   r/   )r0   rS   s     r5   rT   zTransformer.__init__Ô   rU   r7   c                 ó   — y r.   r/   )rR   rS   s     r5   Úfrom_contextzTransformer.from_contextÖ   s   € ØHKr7   c                 ó   — y r.   r/   rD   s    r5   rG   zTransformer.connectionÙ   s   € Ø8;r7   c                 ó   — y r.   r/   rD   s    r5   ÚencodingzTransformer.encodingÜ   s   € Ø"r7   c                 ó   — y r.   r/   rD   s    r5   rE   zTransformer.adaptersß   s   € Ø'*r7   c                 ó   — y r.   r/   rD   s    r5   ÚpgresultzTransformer.pgresultâ   s   € Ø+.r7   T)Úset_loadersrO   c                ó   — y r.   r/   )r0   Úresultrx   rO   s       r5   Úset_pgresultzTransformer.set_pgresultå   s   € ð r7   c                 ó   — y r.   r/   ©r0   rm   rO   s      r5   Úset_dumper_typeszTransformer.set_dumper_typesí   rU   r7   c                 ó   — y r.   r/   r}   s      r5   Úset_loader_typeszTransformer.set_loader_typesï   rU   r7   c                 ó   — y r.   r/   )r0   Úparamsrn   s      r5   Údump_sequencezTransformer.dump_sequenceñ   s   € à"%r7   c                 ó   — y r.   r/   rW   s     r5   Ú
as_literalzTransformer.as_literalõ   rU   r7   c                 ó   — y r.   r/   r^   s      r5   Ú
get_dumperzTransformer.get_dumper÷   rU   r7   c                 ó   — y r.   r/   )r0   Úrow0Úrow1Úmake_rows       r5   Ú	load_rowszTransformer.load_rowsù   rU   r7   c                 ó   — y r.   r/   )r0   Úrowr‹   s      r5   Úload_rowzTransformer.load_rowû   rU   r7   c                 ó   — y r.   r/   )r0   Úrecords     r5   Úload_sequencezTransformer.load_sequenceý   rU   r7   c                 ó   — y r.   r/   )r0   rP   rO   s      r5   Ú
get_loaderzTransformer.get_loaderÿ   rU   r7   r.   )rS   rb   )rS   rb   r:   rl   rJ   )r:   ÚstrrI   )r:   úPGresult | None)rz   r–   rx   ÚboolrO   zpq.Format | Noner:   ÚNone)rm   zSequence[int]rO   rN   r:   r˜   )r‚   zSequence[Any]rn   zSequence[PyFormat]r:   úSequence[Buffer | None])rX   r   r:   Úbytesrc   )r‰   r8   rŠ   r8   r‹   úRowMaker[Row]r:   z	list[Row])rŽ   r8   r‹   r›   r:   r   )r‘   r™   r:   ztuple[Any, ...])rP   r8   rO   rN   r:   rf   )r;   r<   r=   rd   rT   Úclassmethodrq   rK   rG   rt   rE   rw   r{   r~   r€   rƒ   r…   r‡   rŒ   r�   r’   r”   r/   r7   r5   rl   rl   Ð   sÄ   … Ø!Ó!Ø#Ó#ä@àÚKó ØKàÚ;ó Ø;àÚ"ó Ø"àÚ*ó Ø*àÚ.ó Ø.ð !Ø#'ñàðð ð	ð
 !ðð 
óó UãTð&Ø#ð&Ø.@ð&à	 ó&ó 1ãCãXãEãTäDr7   rl   )Ar>   Ú
__future__r   Útypingr   r   r   r   r   Úcollections.abcr	   r
   r   r   Ú r   Ú_enumsr   Ú_compatr   r   r   r   Úrowsr   r   Úpq.abcr   Úwaitingr   r   Ú_adapters_mapr   Ú_connection_baser   r   r   rd   rš   Ú	bytearrayÚ
memoryviewr   r   r   r•   r    r!   r#   Útupler$   r8   r%   Údictr&   r'   r(   r)   r*   r,   r?   r@   rB   rM   rf   rl   r/   r7   r5   ú<module>r¬      sã  ðòõ #ç AÕ Aß BÓ Bå Ý (ß 5Ñ 5áÝß#Ý ß$Ý*Ý0á�d“€ˆ$Ó ð ˜% ¨JÐ6Ñ7€ˆ	Ó 7à" =°%¸ÀNÐ#RÑS€�Ó SØ˜¨(Ð2Ñ3€€yÓ 3Ø˜( 3™-¨°°c°Ñ):Ð:Ñ;€ˆ	Ó ;ÙÐ)Ð1FÔG€Ø% b¨$ hÑ/€�Ó /Ø˜T 5Ð)9Ñ#:Ð:Ñ;€	ˆ9Ó ;Ø˜S # t˜^Ñ,€	ˆ9Ó ,Ø˜3 	˜>Ñ*€ˆ)Ó *Ø   i Ñ0€ˆYÓ 0ñ
 ˆTƒ]€à   s¨F {Ñ!3°]ÀBÐ!FÑG€	ˆ9Ó Gðð
 ˜V ]°BÐ6Ñ7€€yÓ 7ðôˆxô ð   ˜u f¨t¡mÐ3Ñ4€ˆ)Ó 4Ø ˜x¨˜}Ñ-€ˆ)Ó -ô�8ô ô4PˆXô PôfˆXô ô0/E�(õ /Er7   