
    (ph                    4   % S r SSKJr  SSKrSSKrSSKJr  SSKJr  SSK	J
r
JrJr  SSK	JrJr  SS	KJrJrJrJrJr  SS
KJrJrJrJr  \R2                  " \5      rS\S'    S\S'    S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   SS jr\" 5         Srg) z
psycopg libpq wrapper

This package exposes the libpq functionalities as Python objects and functions.

The real implementation (the binding to the C library) is
implementation-dependant but all the implementations share the same interface.
    )annotationsN)Callable   )abc)ConninfoOptionPGnotifyPGresAttDesc)error_messageversion_pretty)
ConnStatusDiagnosticField
ExecStatusFormatTrace)PingPipelineStatusPollingStatusTransactionStatusstr__impl__int__build_version__zCallable[[], int]versionztype[abc.PGconn]PGconnztype[abc.PGresult]PGresultztype[abc.Conninfo]Conninfoztype[abc.Escaping]Escapingztype[abc.PGcancel]PGcancelztype[abc.PGcancelConn]PGcancelConnc                 4  ^^ [         R                  R                  SS5      R                  5       mSn / mSUU4S jjnT(       a  TS:X  a   SSKJn   U (       d  T(       a  TS:X  a   SSKJn   U (       d  T(       a  TS	:X  a   S
SKJ	n   U (       am  U R                  q
U R                  qU R                  qU R                  qU R                  qU R                  qU R                   qU R"                  qU R$                  qgT(       a  ['        ST S35      eSR)                  S T 5       5      n['        SU 35      e! [         a  nU" SU5         SnANSnAff = f! [         a  nU" SU5         SnAGNSnAff = f! [         a  nU" S	U5         SnAGN
SnAff = f)z
Import pq objects implementation from the best libpq wrapper available.

If an implementation is requested try to import only it, otherwise
try to import the best implementation available.
PSYCOPG_IMPL Nc                   > T(       d/  SU  SU 3n[         R                  U5        TR                  U5        g SU  SU 3n[        U5      Ue)Nzcouldn't import psycopg 'z' implementation: z#couldn't import requested psycopg ')loggerdebugappendImportError)nameemsgattemptsimpls      F/var/www/html/venv/lib/python3.13/site-packages/psycopg/pq/__init__.pyhandle_error'import_from_libpq.<locals>.handle_errorB   sR    -dV3EaSICLLOOC 7v=OPQsSCc")    cr   )pqbinarypythonr   )	pq_ctypesz"requested psycopg implementation 'z	' unknown
c              3  ,   #    U  H
  nS U 3v   M     g7f)z- N ).0attempts     r-   	<genexpr>$import_from_libpq.<locals>.<genexpr>m   s     EH7)nHs   z(no pq wrapper available.
Attempts made:
)r(   r   r)   	ExceptionreturnNone)osenvirongetlower	psycopg_cr2   r=   psycopg_binaryr"   r5   r   r   r   r   r   r   r   r   r   r'   join)moduler.   r)   	sattemptsr+   r,   s       @@r-   import_from_libpqrI   3   su    ::>>."-335DFH* * 43;	!.
 448#3	&3
 448#3	&- ??..????????**"44	>tfINOOIIEHEE	 
 	
?  	!a  	!  	&1%%	&  	&1%%	&sH   D8 'E E9 8
E	EE
E6"	E11E69
F	FF)r   r   r   r   r   r   r   r   r   r   r   r   r	   r
   r   r   r   )r>   r?   )__doc__
__future__r   r@   loggingtypingr   r"   r   miscr   r   r	   r
   r   _enumsr   r   r   r   r   r   r   r   r   	getLogger__name__r$   __annotations__rI   __all__r8   r0   r-   <module>rT      s    # 	    8 8 / J J J J			8	$

   
  
 
 
 
 $ $@
F  r0   