crud for collections

This commit is contained in:
bdrtr 2025-05-14 18:29:46 +03:00
parent bf71979982
commit 250d3f1f15
4 changed files with 195 additions and 13 deletions

View file

@ -30,11 +30,11 @@ class Base(DeclarativeBase):
#models te içe aktarmayı unutma
def init_db():
Base.metadata.drop_all(engine) # Veritabanını her başlangıcta siler burayada dikkat !!!!!!!!
#Base.metadata.drop_all(engine) # Veritabanını her başlangıcta siler burayada dikkat !!!!!!!!
Base.metadata.create_all(bind=engine) # Veritabanını oluşturur
# Session dependency (FastAPI için)
def get_session_db():
def get_session_db() -> 'Generator[Session, None]':
db = SessionLocal()
try:
yield db