initial commit
This commit is contained in:
13
app/api/deps.py
Normal file
13
app/api/deps.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from collections.abc import Generator
|
||||
from typing import Annotated
|
||||
|
||||
from fastapi import Depends
|
||||
from sqlmodel import Session
|
||||
|
||||
from app.core.db import engine
|
||||
|
||||
def get_db() -> Generator[Session, None, None]:
|
||||
with Session(engine) as session:
|
||||
yield session
|
||||
|
||||
SessionDep = Annotated[Session, Depends(get_db)]
|
||||
Reference in New Issue
Block a user