From 5e16bd5cbca38094b57dd594c8b8f1f8b4b93ad0 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 19 Feb 2025 10:27:51 +0100 Subject: [PATCH] fix: fixed issue that creyPY couldn't be used without PSQL --- creyPY/fastapi/db/__init__.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/creyPY/fastapi/db/__init__.py b/creyPY/fastapi/db/__init__.py index 94b32a2..bcf1c12 100644 --- a/creyPY/fastapi/db/__init__.py +++ b/creyPY/fastapi/db/__init__.py @@ -1,3 +1,8 @@ -from .async_session import * # noqa -from .helpers import * # noqa -from .session import * # noqa +try: + import sqlalchemy + + from .async_session import * + from .helpers import * + from .session import * +except ImportError: + print("SQLAlchemy not installed. Database functionality will be disabled.")