chore: refactor

This commit is contained in:
itqop 2025-11-05 16:37:40 +03:00
parent 87107d8c31
commit d319a1c5e0
1 changed files with 0 additions and 21 deletions

View File

@ -1,21 +0,0 @@
# src/dataloader/storage/db.py
from __future__ import annotations
from typing import AsyncIterator
from sqlalchemy.ext.asyncio import AsyncSession
async def session_scope() -> AsyncIterator[AsyncSession]:
"""
Асинхронный контекст жизненного цикла сессии.
Получает sessionmaker из AppContext.
Yields:
AsyncSession для работы с БД
"""
from dataloader.context import APP_CTX
sm = APP_CTX.sessionmaker
async with sm() as s:
yield s