Skip to content

fix(database): hide bound parameters in errors - #121

Merged
olivermeyer merged 1 commit into
mainfrom
fix/vpthp-128-hide-sql-parameters
Sep 28, 2026
Merged

olivermeyer merged 1 commit into
mainfrom
fix/vpthp-128-hide-sql-parameters

Conversation

@olivermeyer

Copy link
Copy Markdown
Collaborator

Why?
The engine does not set hide_parameters, so a StatementError or a DBAPIError message contains [parameters: (...)] with the statement values. These messages go to Cloud Logging and Sentry, and the values can include job payloads, partner identifiers and URLs (VPTHP-128).

How?
init_engine now passes hide_parameters=True to create_async_engine as a fixed value next to echo=False, not as a setting, because no deployment needs to turn it off. The option removes only the SQLAlchemy parameter suffix. A value that Postgres repeats in its own error text, for example in a unique-violation DETAIL, stays in the message.

🤖 Generated with Claude Code

The engine did not set hide_parameters. So a StatementError or a
DBAPIError message contained "[parameters: (...)]" with the values of
the statement. These messages go to logs and Sentry.

The engine now sets hide_parameters=True.

Refs: VPTHP-128

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Files with missing lines Coverage Δ
src/aignostics_foundry_core/database.py 91.09% <ø> (ø)

@sonarqubecloud

Copy link
Copy Markdown

@olivermeyer
olivermeyer marked this pull request as ready for review September 25, 2026 11:24
@olivermeyer
olivermeyer requested a review from a team as a code owner September 25, 2026 11:24
@olivermeyer
olivermeyer enabled auto-merge (rebase) September 25, 2026 12:37
@olivermeyer
olivermeyer merged commit eea4aeb into main Sep 28, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants