Working state before icon/utils fixes - Oct 22

This commit is contained in:
2025-10-21 21:56:54 +02:00
parent a7d9d44a13
commit 5be47b91a2
39 changed files with 6017 additions and 508 deletions

View File

@@ -1,10 +1,11 @@
# app/core/database.py
"""Summary description ....
"""
Database configuration and session management.
This module provides classes and functions for:
- ....
- ....
- ....
- Database engine creation and configuration
- Session management with connection pooling
- Database dependency for FastAPI routes
"""
import logging
@@ -21,16 +22,19 @@ Base = declarative_base()
logger = logging.getLogger(__name__)
# Database dependency with connection pooling
def get_db():
"""Get database object."""
"""
Database session dependency for FastAPI routes.
Yields a database session and ensures proper cleanup.
Handles exceptions and rolls back transactions on error.
"""
db = SessionLocal()
try:
yield db
except Exception as e:
logger.error(f"Health check failed: {e}")
logger.error(f"Database session error: {e}")
db.rollback()
raise
finally: