Skip to content

Conversation

@taole33
Copy link

@taole33 taole33 commented Dec 9, 2025

Motivation

This PR implements the static getR2dbcUrl() helper method for the MariaDB module, as discussed in #8797.

This implementation follows the static method approach suggested by @eddumelendez in the issue comments (instead of adding it to the interface), ensuring discoverability without breaking changes.

Currently, users have to manually construct connection strings. This helper provides a standardized way to obtain a valid R2DBC URL.

Changes

  • Added public static String getR2dbcUrl(MariaDBContainer<?> container) to MariaDBR2DBCDatabaseContainer.
  • Added test case to verify the URL format and parameters.

Verification

  • Ran ./gradlew :testcontainers-mariadb:test and verified that tests pass.
  • Verified code style with Spotless.

Relates to #8797

This adds a static helper method `getR2dbcUrl(MariaDBContainer)` to generate a valid R2DBC connection string. This simplifies configuration for R2DBC users.

Relates to testcontainers#8797
@taole33 taole33 requested a review from a team as a code owner December 9, 2025 10:55
@eddumelendez eddumelendez changed the title feat(module/mariadb): Add getR2dbcUrl() to MariaDBR2DBCDatabaseContainer Add getR2dbcUrl() to MariaDBR2DBCDatabaseContainer Dec 9, 2025
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