This commit is contained in:
Marek Lenczewski
2026-04-08 08:51:59 +02:00
parent 375a9cd386
commit a0c8ecaf27
12 changed files with 75 additions and 92 deletions

View File

@@ -1,5 +1,8 @@
from typing import Annotated
from fastapi import Depends
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, declarative_base
from sqlalchemy.orm import Session, sessionmaker, declarative_base
DATABASE_URL = "sqlite:///videos/youtubeapp.db"
@@ -18,3 +21,6 @@ def getDb():
yield db
finally:
db.close()
DbSession = Annotated[Session, Depends(getDb)]