Newer
Older
vmk-360-data_collector / src / vmk_data_collector / db / session.py
@Eugene Sukhodolskiy Eugene Sukhodolskiy 1 day ago 310 bytes feat: core pipeline + FastAPI API (Phases 0-6)
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker

from .engine import engine

AsyncSessionLocal = async_sessionmaker(
    engine, class_=AsyncSession, expire_on_commit=False
)


async def get_db_session() -> AsyncSession:
    async with AsyncSessionLocal() as session:
        yield session