02: Changed setup for alembic and sqlAlchemy

This commit is contained in:
exolonConfidental
2026-02-06 22:22:59 +05:30
parent 61162e01fb
commit 8fb3b7cf67
14 changed files with 739 additions and 25 deletions

13
app/db/session.py Normal file
View File

@@ -0,0 +1,13 @@
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_db():
async with AsyncSessionLocal() as session:
yield session