N?F d Z ddlmZ ddlmZ ddlmZ i Z ej dd d Zd Z G d de ZdS ) 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) threadingz1.3zYThe :func:`.pool.manage` function is deprecated, and will be removed in a future release.c t | S # t $ r) t | t | fi | cY S w xY w)aH 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* )proxiesKeyError setdefault_DBProxy)moduleparamss o/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib64/python3.11/site-packages/sqlalchemy/pool/dbapi_proxy.pymanager s] ,Fv F F F!!&(6*D*DV*D*DEEEEEFs 0AAc t D ]} | t dS )zYRemove all current DB-API 2.0 managers. All pools and connections are disposed. N)r valuescloseclear)managers r clear_managersr 5 s= >>## MMOOOOO c F e Zd ZdZefdZd Zd Zd Zd Z d Z d Zd Zd S )r a Layers 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 n || _ || _ || _ i | _ t j | _ dS )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 poolclasspoolsr Lock_create_pool_mutex)selfr r r s r __init__z_DBProxy.__init__I s6 " "+."2"2r c D t | j D ] }| j |= d S N)listr r keys r r z_DBProxy.close\ s0 ## C 3 r c . | d S r! )r )r s r __del__z_DBProxy.__del__` s r c , t | j | S r! )getattrr r# s r __getattr__z_DBProxy.__getattr__c s t{C(((r c j i } j | S # t $ r j | j vrU dd j fdfi j }| j |<