Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make sqlalchemy db logging configurable #130

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading