
    fjh                     2    S SK r SSKJr  S r " S S5      rg)    N   )
exceptionsc                 F   ^  [         R                  " T 5      U 4S j5       nU$ )z@A decorator to add a sanity check to ConnectionResource methods.c                 R   > U R                  TR                  5        T" U /UQ70 UD6$ N)_check_conn_validity__name__)selfargskwargsmeths      M/var/www/html/GQ-WA/venv/lib/python3.13/site-packages/asyncpg/connresource.py_checkguarded.<locals>._check   s*    !!$--0D*4*6**    )	functoolswraps)r   r   s   ` r   guardedr      s'     __T+ + Mr   c                   $    \ rS rSrSrS rS rSrg)ConnectionResource   )_connection_con_release_ctrc                 2    Xl         UR                  U l        g r   )r   _pool_release_ctrr   )r
   
connections     r   __init__ConnectionResource.__init__   s    % * < <r   c                 t   U R                   R                  nX R                  :w  a:  [        R                  " SR                  U R                  R                  U5      5      eU R                   R                  5       (       a:  [        R                  " SR                  U R                  R                  U5      5      eg )NzQcannot call {}.{}(): the underlying connection has been released back to the poolz8cannot call {}.{}(): the underlying connection is closed)	r   r   r   r   InterfaceErrorformat	__class__r	   	is_closed)r
   	meth_namecon_release_ctrs      r   r   'ConnectionResource._check_conn_validity    s    **<<333++$fT^^%<%<iHJ J
 %%''++66<fNN++Y789 9 (r   )r   r   N)r	   
__module____qualname____firstlineno__	__slots__r   r   __static_attributes__ r   r   r   r      s    3I=9r   r   )r    r   r   r   r,   r   r   <module>r.      s     9 9r   