Skip to content

feat: Add support for database query string using DB_QUERY_JSON variable #2244

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

Merged
merged 1 commit into from
Aug 10, 2025

Conversation

adamantike
Copy link
Contributor

Description
This change adds a new environment variable DB_QUERY_JSON that allows users to specify querystring values for additional database connection parameters. This is useful for passing custom query parameters to the database connection URL.

The DB_QUERY_JSON variable should contain a JSON string with key-value pairs of strings, which is the required format for the SQLAlchemy URL query parameter. If the variable is not set, no additional query parameters will be added to the database connection URL.

Closes #2093.

Checklist

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

This change adds a new environment variable `DB_QUERY_JSON` that allows
users to specify querystring values for additional database connection
parameters. This is useful for passing custom query parameters to the
database connection URL.

The `DB_QUERY_JSON` variable should contain a JSON string with key-value
pairs of strings, which is the required format for the SQLAlchemy URL
`query` parameter. If the variable is not set, no additional query
parameters will be added to the database connection URL.

Closes #2093.
@adamantike adamantike requested review from gantoine and zurdi15 August 10, 2025 03:32
Copy link

trunk-io bot commented Aug 10, 2025

Running Code Quality on PRs by uploading data to Trunk will soon be removed. You can still run checks on your PRs using trunk-action - see the migration guide for more information.

Copy link

Test Results

548 tests   547 ✅  56s ⏱️
  1 suites    1 💤
  1 files      0 ❌

Results for commit 889c714.

Copy link

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
8748 6167 71% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
backend/config/_init_.py 100% 🟢
backend/config/config_manager.py 46% 🟢
TOTAL 73% 🟢

updated for commit: 889c714 by action🐍

@adamantike adamantike merged commit 40e824d into master Aug 10, 2025
9 checks passed
@adamantike adamantike deleted the feat/database-query-string branch August 10, 2025 13:54
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.

[Feature] Connecting Database via Unix-Socket
2 participants