Reorganize project structure

This commit is contained in:
Markus Zimmerberger
2024-11-19 09:22:39 +01:00
parent 48d06341ef
commit 7d76e217f1
13 changed files with 142 additions and 68 deletions
+15
View File
@@ -0,0 +1,15 @@
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, declarative_base
DATABASE_URL = 'postgresql://zisco:ELcowUwryNy0PUf3Jr7z@192.168.1.202:5432/zisco'
engine = create_engine(DATABASE_URL)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
db = SessionLocal()
try:
yield db
finally:
db.close()