-
Notifications
You must be signed in to change notification settings - Fork 92
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
support :tc: in connection URIs #468
Comments
https://www.testcontainers.org/modules/databases/jdbc/ and https://www.testcontainers.org/modules/databases/r2dbc/ for info where it is coming from. |
I don't think this would require any code changes in HR or Vertx, but instead a new module in Testcontainers itself. The R2DBC one works by registering a Testcontainers driver for R2DBC which just proxies to the actual driver. We would probably want to take a similar approach if we did this for Vertx drivers. However, my 2 cents, I'm not a big fan of the |
Well the issue is that the very first thing that Max tried to do with HR was to connect to postgres via a :tc: URI. And I can see him not being the only person to try that. |
(FTR, I'm not a great fan either.) |
The issue is that afaics the necessary code to wire it in is quite massive and redundant compared to this magic url. Btw. It is not really different from how profiling jdbc drivers work. Those are also "magic" URLs. |
Is it really that magical? In the end you are just specifying that you want to use tc in the url. It seems pretty straightforward for simple quick testing.
We might need to keep track of the |
Setting aside the issue of the "magic" URI, which FTR, doesn't have to be the way we expose this feature (we could do it via a separate property setting or whatever), it's true that we wrote a bunch of code for this, and it's code that is surely useful to at least some users. So it seems like something we should share somewhere. |
The stuff we do with URL parsing is sort of a convenience trick so that people can re-use JDBC urls for non-JDBC stuff. Actually, a user should still be able to use a
IMO the best thing to do here is some variation of eclipse-vertx/vertx-sql-client#644 which will give Vertx a proper service loader entry point rather than hard-coding, even if it's just an SPI. |
@maxandersen has observed that the usual way to connect to test containers databases is to use a connection URI of form
jdbc:tc:postgresql:9.6.8:///databasename
.Either we:
We actually already have the code to implement this, it's just in the test suite instead of the core where users can easily make use of it.
So what's it to be @vietj @aguibert? Does this go into Vert.x or does it stay here?
The text was updated successfully, but these errors were encountered: