
    ,h                    ,   % 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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Ping)PipelineStatusPollingStatusTrace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                n   > T(       d  SU  SU 3n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 ')appendImportError)nameemsgattemptsimpls      N/var/www/html/Ai_home/venv/lib/python3.13/site-packages/psycopg/pq/__init__.pyhandle_error'import_from_libpq.<locals>.handle_errorA   sF    -dV3EaSIC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>k   s     EH7)nHs   z(no pq wrapper available.
Attempts made:
)r&   r   r'   	ExceptionreturnNone)osenvirongetlower	psycopg_cr0   r;   psycopg_binaryr"   r3   r   r   r   r   r   r   r   r   r   r%   join)moduler,   r'   	sattemptsr)   r*   s       @@r+   import_from_libpqrG   2   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__logger__annotations__rG   __all__r6   r.   r+   <module>rS      s    # 	    W W I I K K			8	$

   
  
 
 
 
 $ $?
D  r.   