Vorbereitung Release 0.2.0
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from typing import Generator
|
||||
|
||||
from fastapi import Depends
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
@@ -10,6 +11,9 @@ engine = create_engine(SQLALCHEMY_DATABASE_URL)
|
||||
|
||||
SessionLocal = sessionmaker(bind=engine)
|
||||
|
||||
|
||||
def get_db() -> Generator:
|
||||
with SessionLocal() as db:
|
||||
yield db
|
||||
|
||||
SessionDep: type[Session] = Annotated[Session, Depends(get_db)]
|
||||
|
||||
Reference in New Issue
Block a user