create base models(users,tasks)
This commit is contained in:
14
src/api/dependancies.py
Normal file
14
src/api/dependancies.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from typing import Annotated
|
||||
|
||||
from fastapi import Depends
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from src.db.database import async_session_maker
|
||||
|
||||
|
||||
async def get_db():
|
||||
async with async_session_maker as db:
|
||||
yield db
|
||||
|
||||
|
||||
DBDep = Annotated[AsyncSession, Depends(get_db)]
|
||||
Reference in New Issue
Block a user