
    +h              	       x    d dl mZ ddlmZ ddlmZ ddlmZ  eeddg dg d	g d
       G d de             Zy)   )AsyncSession   )ScopedSessionMixin)create_proxy_methods)ScopedRegistryz:class:`_asyncio.AsyncSession`z.:class:`_asyncio.scoping.async_scoped_session`)	close_allobject_sessionidentity_key)__contains____iter__addadd_allbeginbegin_nestedclosecommit
connectiondeleteexecuteexpire
expire_allexpungeexpunge_allflushgetget_bindis_modified
invalidatemergerefreshrollbackscalarscalarsstreamstream_scalars)	binddirtydeletednewidentity_map	is_active	autoflushno_autoflushinfo)classmethodsmethods
attributesc                   0    e Zd ZdZdZd Zed        Zd Zy)async_scoped_sessionzProvides scoped management of :class:`.AsyncSession` objects.

    See the section :ref:`asyncio_scoped_session` for usage details.

    .. versionadded:: 1.4.19


    Tc                 4    || _         t        ||      | _        y)a  Construct a new :class:`_asyncio.async_scoped_session`.

        :param session_factory: a factory to create new :class:`_asyncio.AsyncSession`
         instances. This is usually, but not necessarily, an instance
         of :class:`_orm.sessionmaker` which itself was passed the
         :class:`_asyncio.AsyncSession` to its :paramref:`_orm.sessionmaker.class_`
         parameter::

            async_session_factory = sessionmaker(some_async_engine, class_= AsyncSession)
            AsyncSession = async_scoped_session(async_session_factory, scopefunc=current_task)

        :param scopefunc: function which defines
         the current scope.   A function such as ``asyncio.current_task``
         may be useful here.

        N)session_factoryr   registry)selfr5   	scopefuncs      Q/var/www/html/venv/lib/python3.12/site-packages/sqlalchemy/ext/asyncio/scoping.py__init__zasync_scoped_session.__init__H   s    $  /&	B    c                 "    | j                         S )N)r6   r7   s    r9   _proxiedzasync_scoped_session._proxied]   s    }}r;   c                    K   | j                   j                         r&| j                         j                          d{    | j                   j                          y7 w)zDispose of the current :class:`.AsyncSession`, if present.

        Different from scoped_session's remove method, this method would use
        await to wait for the close method of AsyncSession.

        N)r6   hasr   clearr=   s    r9   removezasync_scoped_session.removea   sE      ==--/''))) *s   <A A A N)	__name__
__module____qualname____doc___support_asyncr:   propertyr>   rB    r;   r9   r3   r3      s.    ^ NC*  
r;   r3   N)sessionr   orm.scopingr   utilr   r   r3   rI   r;   r9   <module>rM      sN    " - ( " $4@:
E-\/- /]-\/r;   