Spaces:
Sleeping

agentic / backend /app /core /database.py
Heng
HolidayPilot: multi-agent holiday planner with real live APIs
dd75a48
Raw History Blame Contribute Delete
450 Bytes
from __future__ import annotations
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine
from app.core.config import settings
engine = create_async_engine(settings.database_url, echo=settings.debug)
async_session = async_sessionmaker(engine, class_=AsyncSession, expire_on_commit=False)
async def get_db() -> AsyncSession: # type: ignore[misc]
async with async_session() as session:
yield session