14 lines
313 B
Python
14 lines
313 B
Python
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker
|
|
from app.db.database import engine
|
|
|
|
AsyncSessionLocal = async_sessionmaker(
|
|
bind=engine,
|
|
expire_on_commit=False,
|
|
autoflush=False
|
|
)
|
|
|
|
|
|
async def get_async_session():
|
|
async with AsyncSessionLocal() as session:
|
|
yield session
|