diff --git a/geomagio/api/db/database.py b/geomagio/api/db/database.py index 74fb3211b2e94bc9f556c62b9c39c497efb7bc0a..8b21cfa80ba94ed8f090a5da7cc8e9c741c6baea 100644 --- a/geomagio/api/db/database.py +++ b/geomagio/api/db/database.py @@ -5,6 +5,7 @@ from sqlmodel import create_engine from geomagio.api.db.models.metadata import MetadataTable from geomagio.api.db.models.metadata_history import MetadataHistoryTable +from geomagio.api.db.models.session import session class Tables(str, Enum): @@ -13,4 +14,9 @@ class Tables(str, Enum): database_url = os.getenv("DATABASE_URL", "sqlite:///./api_database.db") -engine = create_engine(database_url) + +try: + engine = create_engine(database_url) +except Exception as e: + print("error creating engine:", e) + pass