Skip to content

Commit

Permalink
feat: make sqlalchemy db logging configurable (#130)
Browse files Browse the repository at this point in the history
closes #129
  • Loading branch information
lchen-2101 authored Mar 21, 2024
1 parent 1da51f5 commit 3d846b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/regtech_user_fi_management/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/regtech_user_fi_management/entities/engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3d846b2

Please sign in to comment.