File size: 303 Bytes
66340f1
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
from typing import AsyncGenerator

from sqlalchemy.ext.asyncio.session import AsyncSession

from app.db import async_session_maker


async def get_async_session() -> AsyncGenerator[AsyncSession, None]:
    async with async_session_maker() as session:
        yield session
        await session.close()