📚 Improved database structure & utils with new files for shm, wal, and enhanced debugging tools. 🆓

This commit is contained in:
2025-05-31 18:17:58 +02:00
parent 34692dbb32
commit d3f7d66112
10 changed files with 163 additions and 34 deletions

View File

@@ -33,7 +33,7 @@ _cache_lock = threading.Lock()
_cache_ttl = {} # Time-to-live für Cache-Einträge
# Alle exportierten Modelle
__all__ = ['User', 'Printer', 'Job', 'Stats', 'SystemLog', 'Base', 'GuestRequest', 'UserPermission', 'Notification', 'init_db', 'init_database', 'create_initial_admin', 'get_db_session', 'get_cached_session', 'clear_cache']
__all__ = ['User', 'Printer', 'Job', 'Stats', 'SystemLog', 'Base', 'GuestRequest', 'UserPermission', 'Notification', 'init_db', 'init_database', 'create_initial_admin', 'get_db_session', 'get_cached_session', 'clear_cache', 'engine']
# ===== DATENBANK-KONFIGURATION MIT WAL UND OPTIMIERUNGEN =====
@@ -998,4 +998,12 @@ def create_initial_admin(email: str = "admin@mercedes-benz.com", password: str =
except Exception as e:
logger.error(f"Fehler beim Erstellen des Admin-Benutzers: {str(e)}")
return False
return False
# Engine für Export verfügbar machen
def get_engine():
"""Gibt die optimierte Datenbank-Engine zurück."""
return create_optimized_engine()
# Engine-Variable für direkten Import
engine = get_engine()