starr/db.py
def with_connection(func: t.Callable[..., t.Any]) -> t.Callable[..., t.Any]:
        """A decorator used to acquire a connection from the pool."""

        @functools.wraps(func)
        async def wrapper(self: Database, *args: t.Any) -> t.Any:
            async with self.pool.acquire() as conn:
                return await func(self, *args, conn=conn)

        return wrapper
A decorator used to acquire a connection from the pool.
A decorator used to acquire a connection from the pool.
A decorator used to acquire a connection from the pool .
def with_connection(func: t.Callable[..., t.Any]) -> t.Callable[..., t.Any]:
        @functools.wraps(func)
        async def wrapper(self: Database, *args: t.Any) -> t.Any:
            async with self.pool.acquire() as conn:
                return await func(self, *args, conn=conn)
        return wrapper
def with_connection ( func : t . Callable [ ... , t . Any ] ) -> t . Callable [ ... , t . Any ] : @ functools . wraps ( func ) async def wrapper ( self : Database , * args : t . Any ) -> t . Any : async with self . pool . acquire ( ) as conn : return await func ( self , * args , conn = conn ) return wrapper
A decorator used to acquire a connection from the pool.
A decorator used to acquire a connection from the pool .
"""A decorator used to acquire a connection from the pool."""
func
t.Callable[..., t.Any]