Files
python-api/app/api/deps.py
2026-03-01 07:44:19 +09:00

13 lines
285 B
Python

from __future__ import annotations
from collections.abc import AsyncGenerator
from sqlalchemy.ext.asyncio import AsyncSession
from app.db.mariadb import get_db
async def get_session() -> AsyncGenerator[AsyncSession, None]:
async for session in get_db():
yield session