Skip to content

Add getR2dbcUrl helper method to JdbcDatabaseContainer - #11969

Open
Rajkaran-122 wants to merge 1 commit into
testcontainers:mainfrom
Rajkaran-122:feature/add-r2dbc-url-helper
Open

Add getR2dbcUrl helper method to JdbcDatabaseContainer#11969
Rajkaran-122 wants to merge 1 commit into
testcontainers:mainfrom
Rajkaran-122:feature/add-r2dbc-url-helper

Conversation

@Rajkaran-122

Copy link
Copy Markdown

Adds a convenience method to generate R2DBC connection strings from JDBC URLs, similar to the existing getJdbcUrl() method. This makes integration with R2DBC drivers more seamless.

Fixes #8797

Adds a convenience method to generate R2DBC connection strings
from JDBC URLs, similar to the existing getJdbcUrl() method.
This makes integration with R2DBC drivers more seamless.

Fixes testcontainers#8797
@Rajkaran-122
Rajkaran-122 requested a review from a team as a code owner August 15, 2026 08:04
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d9e2ea59-f03c-42f4-aaee-b47508686939

📥 Commits

Reviewing files that changed from the base of the PR and between 2ac3c97 and d4dce64.

📒 Files selected for processing (2)
  • modules/jdbc/src/main/java/org/testcontainers/containers/JdbcDatabaseContainer.java
  • modules/jdbc/src/test/java/org/testcontainers/containers/JdbcDatabaseContainerTest.java

Summary by CodeRabbit

  • New Features

    • Added support for retrieving an R2DBC connection URL from a database container’s JDBC URL.
  • Tests

    • Added coverage confirming correct JDBC-to-R2DBC URL conversion for MySQL containers.

Walkthrough

The JDBC container API now provides getR2dbcUrl(). The method converts the jdbc: scheme to r2dbc:. A test verifies the conversion for a MySQL URL.

Changes

R2DBC URL helper

Layer / File(s) Summary
Add and validate R2DBC URL conversion
modules/jdbc/src/main/java/org/testcontainers/containers/JdbcDatabaseContainer.java, modules/jdbc/src/test/java/org/testcontainers/containers/JdbcDatabaseContainerTest.java
JdbcDatabaseContainer adds public getR2dbcUrl(). The test verifies conversion of a JDBC MySQL URL to an R2DBC URL.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to d4dce

This localized helper-method change is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

Suggested reviewers: eddumelendez, kiview, pioorg

Poem

A bunny found a JDBC trail,
And changed its sign with care:
“r2dbc:” now leads the way,
With tests to prove it there.
Hop, hop—connections bloom!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the addition of the getR2dbcUrl helper method to JdbcDatabaseContainer.
Description check ✅ Passed The description explains the new functionality, its benefit, and references issue #8797.
Linked Issues check ✅ Passed The changes add getR2dbcUrl, convert JDBC URLs to R2DBC URLs, and include a validating test for issue #8797.
Out of Scope Changes check ✅ Passed The changes are limited to the requested helper method and its focused test.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Warning

⚠️ This pull request shows signs of AI-generated slop (redundant_comments). It has been flagged by CodeRabbit slop detection and should be reviewed carefully.

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.

Add getR2dbcUrl helper method to JdbcDatabaseContainer

1 participant