o
    "4g                     @  s   U d Z ddlmZ ddlZddlZddlmZ ddlmZ ddl	m
Z
mZmZ ddl	mZ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 eeZded< 	 ded< 	 ded< ded< ded< ded< ded< ded< ded< d"dd Ze  d!ZdS )#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]PGcancelConnreturnNonec               
     s  t jdd d} g  d fd
d}rdkr;zddlm}  W n ty: } z|d| W Y d}~nd}~ww | scrCdkrczddlm}  W n tyb } z|d| W Y d}~nd}~ww | srkdkrzddlm	}  W n ty } z|d| W Y d}~nd}~ww | r| j
a
| ja| ja| ja| ja| ja| ja| ja| jadS rtd dddd  D }td| )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 Nnamer   e	Exceptionr   r    c                   s<   sd|  d| }  | d S d|  d| }t||)Nzcouldn't import psycopg 'z' implementation: z#couldn't import requested psycopg ')appendImportError)r#   r$   msgattemptsimpl Y/var/www/html/notificationserver/venv/lib/python3.10/site-packages/psycopg/pq/__init__.pyhandle_errorB   s
   
z'import_from_libpq.<locals>.handle_errorcr   )pqbinarypythonr   )	pq_ctypesz"requested psycopg implementation 'z	' unknown
c                 s  s    | ]}d | V  qdS )z- Nr,   ).0attemptr,   r,   r-   	<genexpr>l   s    z$import_from_libpq.<locals>.<genexpr>z(no pq wrapper available.
Attempts made:
)r#   r   r$   r%   r   r    )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)   r-   import_from_libpq3   sV   	
rA   )r   r   r   r   r   r   r   r   r   r   r   r   r   r	   r   r   r
   )r   r    )__doc__
__future__r   r8   loggingtypingr   r"   r   miscr   r   r   r	   r
   _enumsr   r   r   r   r   r   r   r   r   	getLogger__name__logger__annotations__rA   __all__r,   r,   r,   r-   <module>   s2    
	
B