Skip to content

feat(questdb): Append URL parameters in QuestDBContainer.getJdbcUrl() - #12074

Open
mohamedtoukhy03 wants to merge 1 commit into
testcontainers:mainfrom
mohamedtoukhy03:questdb-append-url-params
Open

feat(questdb): Append URL parameters in QuestDBContainer.getJdbcUrl()#12074
mohamedtoukhy03 wants to merge 1 commit into
testcontainers:mainfrom
mohamedtoukhy03:questdb-append-url-params

Conversation

@mohamedtoukhy03

@mohamedtoukhy03 mohamedtoukhy03 commented Sep 12, 2026

Copy link
Copy Markdown

What does this PR do?

Currently, QuestDBContainer.getJdbcUrl() does not include query parameters configured via withUrlParam(key, value). This PR updates QuestDBContainer.getJdbcUrl() to append URL parameters via constructUrlParameters("?", "&"), use POSTGRES_PORT, and overrides getDatabaseName() to return getDefaultDatabaseName().

This aligns QuestDBContainer with the other JDBC database containers in Testcontainers (such as PostgreSQL, CockroachDB, TiDB, MariaDB, etc.).

Why are these changes needed?

Users who configure connection parameters on QuestDBContainer (e.g., SSL options, binary transfer, or session parameters) expect getJdbcUrl() to contain them when connecting via JDBC.

How was this tested?

Added tests in SimpleQuestDBTest:

  • testWithAdditionalUrlParamInJdbcUrl: Verifies URL parameters configured with .withUrlParam(...) are correctly appended to getJdbcUrl().
  • testDatabaseName: Verifies getDatabaseName() returns "qdb".

Summary by CodeRabbit

  • Bug Fixes
    • JDBC URLs now use the configured database name and port consistently.
    • Additional JDBC URL parameters are now included when configured.
    • The default QuestDB database name is exposed as qdb.

@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: a734f69b-cab6-411f-82d3-6ec648b023f1

📥 Commits

Reviewing files that changed from the base of the PR and between 8e54951 and f8a0569.

📒 Files selected for processing (2)
  • modules/questdb/src/main/java/org/testcontainers/containers/QuestDBContainer.java
  • modules/questdb/src/test/java/org/testcontainers/junit/questdb/SimpleQuestDBTest.java

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

QuestDBContainer now exposes its default database name and includes configured URL parameters in generated JDBC URLs. Tests cover additional JDBC parameters and the "qdb" database name.

Changes

QuestDB JDBC integration

Layer / File(s) Summary
JDBC URL and database name
modules/questdb/src/main/java/org/testcontainers/containers/QuestDBContainer.java
QuestDBContainer exposes "qdb" through getDatabaseName() and builds JDBC URLs with POSTGRES_PORT, the database name, and configured URL parameters.
JDBC URL validation
modules/questdb/src/test/java/org/testcontainers/junit/questdb/SimpleQuestDBTest.java
Tests verify that additional URL parameters are included and that the database name is "qdb".

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: eddumelendez

Merge Risk: ⚪ Minimal · up to f8a05

The change adds the requested QuestDB JDBC URL parameters and database name behavior without an identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: appending URL parameters in QuestDBContainer.getJdbcUrl().
Description check ✅ Passed The description explains the current behavior, the proposed fix, the reason for the change, and the tests added. It provides the information required by the repository template.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant