
    -hz                     ~    S r SSKJr  SSKJr  SSKJr  0 r\R                  " SS5      S 5       rS	 r	 " S
 S\
5      rg)zDBAPI proxy utility.

Provides transparent connection pooling on top of a Python DBAPI.

This is legacy SQLAlchemy functionality that is not typically used
today.

   )	QueuePool   )util)	threadingz1.3zYThe :func:`.pool.manage` function is deprecated, and will be removed in a future release.c           	      v     [         U    $ ! [         a#    [         R                  U [        U 40 UD65      s $ f = f)a   Return a proxy for a DB-API module that automatically
pools connections.

Given a DB-API 2.0 module and pool management parameters, returns
a proxy for the module that will automatically pool connections,
creating new connection pools for each distinct set of connection
arguments sent to the decorated module's connect() function.

:param module: a DB-API 2.0 database module

:param poolclass: the class used by the pool module to provide
  pooling.  Defaults to :class:`.QueuePool`.

:param \**params: will be passed through to *poolclass*

)proxiesKeyError
setdefault_DBProxy)moduleparamss     pC:\Users\ROHAN GUPTA\OneDrive\Desktop\mathbuddy-assessment\venv\Lib\site-packages\sqlalchemy/pool/dbapi_proxy.pymanager      s@    ,Fv F!!&(6*DV*DEEFs    *88c                      [         R                  5        H  n U R                  5         M     [         R                  5         g)zQRemove all current DB-API 2.0 managers.

All pools and connections are disposed.
N)r   valuescloseclear)managers    r   clear_managersr   5   s'     >># $MMO    c                   N    \ rS rSrSr\4S jrS rS rS r	S r
S rS	 rS
 rSrg)r   @   zLayers connection pooling behavior on top of a standard DB-API module.

Proxies a DB-API 2.0 connect() call to a connection pool keyed to the
specific connect parameters. Other functions and attributes are delegated
to the underlying DB-API module.
c                 j    Xl         X0l        X l        0 U l        [        R
                  " 5       U l        g)zInitializes a new proxy.

module
  a DB-API 2.0 module

poolclass
  a Pool class, defaulting to QueuePool

Other parameters are sent to the Pool object's constructor.

N)r   kw	poolclasspoolsr   Lock_create_pool_mutex)selfr   r   r   s       r   __init___DBProxy.__init__I   s)     "
"+.."2r   c                 V    [        U R                  5       H  nU R                  U	 M     g N)listr   r   keys     r   r   _DBProxy.close\   s     

#C

3 $r   c                 $    U R                  5         g r#   )r   )r   s    r   __del___DBProxy.__del__`   s    

r   c                 .    [        U R                  U5      $ r#   )getattrr   r%   s     r   __getattr___DBProxy.__getattr__c   s    t{{C((r   c                   ^ ^^ T R                   " T0 TD6n T R                  U   $ ! [         a    T R                     UT R                  ;  aQ  TR	                  SS 5        T R
                  " UUU 4S j40 T R                  D6nUT R                  U'   UsS S S 5        s $ T R                  U   sS S S 5        s $ ! , (       d  f        g = ff = f)Nsa_pool_keyc                  <   > TR                   R                  " T 0 TD6$ r#   )r   connect)argsr   r   s   r   <lambda>#_DBProxy.get_pool.<locals>.<lambda>o   s     3 3T @R @r   )
_serializer   r	   r   popr   r   )r   r3   r   r&   pools   ```  r   get_pool_DBProxy.get_poolf   s    oot*r*	+::c?" 
	+((djj(FF=$/>>@DHGGD '+DJJsO )(  ::c? )(((
	+s3   & CAB8
CB8,
C8
C	CCc                 B    U R                   " U0 UD6R                  5       $ )a  Activate a connection to the database.

Connect to the database using this DBProxy's module and the given
connect arguments.  If the arguments match an existing pool, the
connection will be returned from the pool's current thread-local
connection instance, or if there is no thread-local connection
instance it will be checked out from the set of pooled connections.

If the pool has no available connections and allows new connections
to be created, a new database connection will be made.

)r9   r2   )r   r3   r   s      r   r2   _DBProxy.connectv   s!     }}d)b)1133r   c                 d    U R                   " U0 UD6n U R                  U	 g! [         a     gf = f)z;Dispose the pool referenced by the given connect arguments.N)r6   r   r	   )r   r3   r   r&   s       r   dispose_DBProxy.dispose   s9     oot*r*	

3 		s   " 
//c           	          SU;   a  US   $ [        [        U5      [        U5       Vs/ s H  o3X#   4PM
     sn-   5      $ s  snf )Nr0   )tupler$   sorted)r   r3   r   ks       r   r6   _DBProxy._serialize   sC    Bm$$T$Zvbz"Bz!ru:z"BBCC"Bs   A 
)r   r   r   r   r   N)__name__
__module____qualname____firstlineno____doc__r   r    r   r)   r-   r9   r2   r>   r6   __static_attributes__ r   r   r   r   @   s5     *3 3& )+ 4 Dr   r   N)rI   implr    r   r   r   
deprecatedr   r   objectr   rK   r   r   <module>rP      sV      
 	#
F
F.SDv SDr   