testcontainers/testcontainers-java

Add getR2dbcUrl helper method to JdbcDatabaseContainer

Open

#8,797 opened on Jun 23, 2024

View on GitHub
 (13 comments) (0 reactions) (0 assignees)Java (7,535 stars) (1,588 forks)batch import
good first issuemodules/r2dbctype/enhancement

Description

Module

Core

Problem

I might've been chosen the wrong module, sorry for that, haven't found one for all RDBMS containers.

There is a convenient method, getJdbcUrl in JdbcDatabaseContainer. The problem however, if I'm working with R2DBC the connection string schema is different. Currently, I have to create an R2DBC connection string myself, which is a bit tedious.

Solution

It would be great to have a similar method in JdbcDatabaseContainer, like getR2dbcUrl that would construct the R2DBC compliant connection string.

Benefit

This would make integration with R2DBC drivers more seamless and provide better developer experience.

Alternatives

The alternative, I think, is to create the connection string manually, which might be fine, not a big deal, until you have to do it over and over again, in which case it became really frustrating.

Would you like to help contributing this feature?

Yes

Contributor guide