diff --git a/src/regtech_user_fi_management/config.py b/src/regtech_user_fi_management/config.py index 91c7cb6..ca4c963 100644 --- a/src/regtech_user_fi_management/config.py +++ b/src/regtech_user_fi_management/config.py @@ -25,6 +25,7 @@ class Settings(BaseSettings): inst_db_scheme: str = "postgresql+asyncpg" inst_conn: str | None = None admin_scopes: Set[str] = set(["query-groups", "manage-users"]) + db_logging: bool = True def __init__(self, **data): super().__init__(**data) diff --git a/src/regtech_user_fi_management/entities/engine/engine.py b/src/regtech_user_fi_management/entities/engine/engine.py index b1cdff2..b7d591c 100644 --- a/src/regtech_user_fi_management/entities/engine/engine.py +++ b/src/regtech_user_fi_management/entities/engine/engine.py @@ -6,7 +6,7 @@ from asyncio import current_task from regtech_user_fi_management.config import settings -engine = create_async_engine(str(settings.inst_conn), echo=True).execution_options( +engine = create_async_engine(str(settings.inst_conn), echo=settings.db_logging).execution_options( schema_translate_map={None: settings.inst_db_schema} ) SessionLocal = async_scoped_session(async_sessionmaker(engine, expire_on_commit=False), current_task)