feat: first commit, auth
This commit is contained in:
11
db/session.py
Normal file
11
db/session.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from sqlalchemy.ext.asyncio import async_sessionmaker, create_async_engine
|
||||
|
||||
from config import cfg
|
||||
|
||||
engine = create_async_engine(cfg.db_url, echo=True)
|
||||
async_session = async_sessionmaker(bind=engine, expire_on_commit=False)
|
||||
|
||||
|
||||
async def get_db():
|
||||
async with async_session() as session:
|
||||
yield session
|
||||
Reference in New Issue
Block a user