Files
group_fqcd_jr/app/infrastructure/db.py
T

7 lines
296 B
Python
Raw Normal View History

2026-09-09 21:55:37 +08:00
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine
from app.core.config import get_settings
engine = create_async_engine(get_settings().mysql_dsn, pool_pre_ping=True)
SessionFactory = async_sessionmaker(engine, class_=AsyncSession, expire_on_commit=False)