
    (phV                    .   S r SSKJr  SSKJrJr  SSKJrJr  SSK	J
r
Jr  SSKJr  SSKJr  SS	KJr  \(       a  SS
KJr  \R&                  r\" S5      r " S S\R,                  \5      r " S S\R.                  \5      r " S S\5      r " S S\5      rg)z)
Entry point into the adaptation system.
    )annotations)ABCabstractmethod)AnyTYPE_CHECKING   )pqabc)PyFormat)Transformer)AdaptersMap)BaseConnection\c                      \ rS rSr% SrSrS\S'    \R                  R                  r
S\S'    SSS	 jjrSS
 jr\SS j5       rSS jrSS jrSS jrSrg)Dumper   zH
Convert Python object of the type `!cls` to PostgreSQL representation.
r   intoid	pq.FormatformatNc                T    Xl         U   U(       a  UR                  U l        g S U l        g Ncls
connection)selfr   contexts      @/var/www/html/venv/lib/python3.13/site-packages/psycopg/adapt.py__init__Dumper.__init__&       07',,T    c           
         S[        U 5      R                   S[        U 5      R                   SU R                   S[	        U 5      S S3	$ )N<.z (oid=z) at 0xx>)type
__module____qualname__r   id)r   s    r   __repr__Dumper.__repr__+   sH    T
%%&aT
(?(?'@TXXJgbhq\4	
r"   c                    g r    )r   objs     r   dumpDumper.dump1   s    /2r"   c                   U R                  U5      nUc  gU R                  (       a;  [        R                  " U R                  R                  5      nUR                  U5      $ [        R                  " 5       nUR                  U5      n[        U;  a  SU-   S-   $ SU-   S-   nUR                  S5      S:X  a  UR                  SS5      nU$ )z
By default return the `dump()` value quoted and sanitised, so
that the result can be used to build a SQL string. This works well
for most types and you won't likely have to implement this method in a
subclass.
s   NULL   's    E'   \s   \\)	r1   r   r	   Escapingpgconnescape_literalescape_stringORD_BSreplace)r   r0   valueescoutrvs         r   quoteDumper.quote4   s     		#=??++doo445C%%e,, kkm&  #:$$ SL4'U#u,E7+B	r"   c                    U R                   $ )ap  
Implementation of the `~psycopg.abc.Dumper.get_key()` member of the
`~psycopg.abc.Dumper` protocol. Look at its definition for details.

This implementation returns the `!cls` passed in the constructor.
Subclasses needing to specialise the PostgreSQL type according to the
*value* of the object dumped (not only according to to its type)
should override this class.

)r   r   r0   r   s      r   get_keyDumper.get_keya   s     xxr"   c                    U $ )a  
Implementation of the `~psycopg.abc.Dumper.upgrade()` member of the
`~psycopg.abc.Dumper` protocol. Look at its definition for details.

This implementation just returns `!self`. If a subclass implements
`get_key()` it should probably override `!upgrade()` too.
r/   rC   s      r   upgradeDumper.upgraden   s	     r"   r   r   r   r(   r   abc.AdaptContext | None)returnstr)r0   r   rK   zBuffer | None)r0   r   rK   Buffer)r0   r   r   r   rK   zabc.DumperKey)r0   r   r   r   rK   r   )__name__r)   r*   __firstlineno____doc__r   __annotations__r	   FormatTEXTr   r   r,   r   r1   r@   rD   rG   __static_attributes__r/   r"   r   r   r      sU     CL2		FI&(B

 2 2+Zr"   r   c                  t    \ rS rSr% Sr\R                  R                  rS\	S'    S	S
S jjr
\SS j5       rSrg)Loadery   zC
Convert PostgreSQL values with type OID `!oid` to Python objects.
r   r   Nc                T    Xl         U   U(       a  UR                  U l        g S U l        g r   )r   r   )r   r   r   s      r   r   Loader.__init__   r!   r"   c                    g)z.Convert a PostgreSQL value to a Python object.Nr/   )r   datas     r   loadLoader.load   s     	r"   )r   r   r   r   r   r   rJ   )r[   rM   rK   r   )rN   r)   r*   rO   rP   r	   rR   rS   r   rQ   r   r   r\   rT   r/   r"   r   rV   rV   y   s8     		FI&(B
  r"   rV   c                  4   ^  \ rS rSrSrSSU 4S jjjrSrU =r$ )RecursiveDumper   z:Dumper with a transformer to help dumping recursive types.c                Z   > [         TU ]  X5        [        R                  " U5      U l        g r   superr   r   from_context_tx)r   r   r   	__class__s      r   r   RecursiveDumper.__init__   "    &++G4r"   rf   r   rI   rN   r)   r*   rO   rP   r   rT   __classcell__rg   s   @r   r`   r`          D5 5r"   r`   c                  4   ^  \ rS rSrSrSSU 4S jjjrSrU =r$ )RecursiveLoader   z:Loader with a transformer to help loading recursive types.c                Z   > [         TU ]  X5        [        R                  " U5      U l        g r   rc   )r   r   r   rg   s      r   r   RecursiveLoader.__init__   ri   r"   rj   r   r^   rk   rm   s   @r   rp   rp      rn   r"   rp   N)rP   
__future__r   r
   r   r   typingr   r    r	   _enumsr   _transformerr   _adapters_mapr   _connection_baser   rM   ordr:   r   rV   r`   rp   r/   r"   r   <module>r|      sz    # # %  ) 4 50		T[SZZ [|SZZ &5f 55f 5r"   