11 lines
265 B
Python
11 lines
265 B
Python
from collections.abc import AsyncIterator
|
|
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
|
|
from app.infrastructure.db import SessionFactory
|
|
|
|
|
|
async def get_session() -> AsyncIterator[AsyncSession]:
|
|
async with SessionFactory() as session:
|
|
yield session
|