Team Ai
Apppublic

ruby2210/todo-manager

sourceHugging Facemitupdated 9mo agoView on Hugging Face
0likes
session.py17 linesDownload Raw Back to database
1from sqlalchemy.ext.asyncio import AsyncSession2from typing import AsyncGenerator3 4 5# Import the get_async_session function from config6from .config import get_async_session as get_db_session7 8 9async def get_async_session() -> AsyncGenerator[AsyncSession, None]:10    """11    Get async database session for dependency injection.12 13    This function is a wrapper around the get_async_session from config14    to maintain consistency with the import pattern.15    """16    async for session in get_db_session():17        yield session