This commit is contained in:
2025-12-27 01:13:30 +01:00
commit aa1f5e30d9
14 changed files with 1500 additions and 0 deletions

16
testarena_app/database.py Normal file
View File

@@ -0,0 +1,16 @@
from sqlalchemy import create_all_engines, create_engine
from sqlalchemy.orm import sessionmaker
import os
# Using SQLite for simplicity as requested
DATABASE_URL = "sqlite:///d:/ASF - course/ASF_01/ASF_tools/asf-pc-server/testarena_pc_backend/testarena_app/testarena.db"
engine = create_engine(DATABASE_URL, connect_args={"check_same_thread": False})
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
def get_db():
db = SessionLocal()
try:
yield db
finally:
db.close()