Skip to content
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 in DevServices for additional JDBC URL parameters #15579

Closed
knutwannheden opened this issue Mar 9, 2021 · 5 comments · Fixed by #15749
Closed

Support in DevServices for additional JDBC URL parameters #15579

knutwannheden opened this issue Mar 9, 2021 · 5 comments · Fixed by #15749
Labels
Milestone

Comments

@knutwannheden
Copy link
Contributor

Description
The DevServices feature currently doesn't yet support setting additional URL parameters for the created database. Some database (like Oracle and MySQL for example) allow specifying various parameters (e.g. time zone) as JDBC URL parameters. Currently the JDBC URL will be constructed by Testcontainers, so to specify URL parameters the Dev Service would have to call org.testcontainers.containers.JdbcDatabaseContainer#withUrlParam().

Currently DevServicesDatasourceProvider#startDatabase() declares a parameter Map<String, String> additionalProperties. I am however not quite sure about the intended purpose of this parameter. While Testcontainers currently doesn't support specifying parameters (which would be passed to java.sql.Driver#connect(String, Properties)), this isn't really necessary either, because Dev Services doesn't delegate the Connection creation to Testcontainers, only the JDBC URL creation.

Implementation ideas
Possibly the Map<String, String> additionalProperties parameter could be (renamed and) repurposed. Or if I have misunderstood its purpose, possibly a new parameter could be introduced which would allow specifying additional JDBC URL parameters.

@knutwannheden knutwannheden added the kind/enhancement New feature or request label Mar 9, 2021
@knutwannheden
Copy link
Contributor Author

I don't know if it would make sense to parse the JDBC URL config property for the datasource and extract the URL parameters from that or whether there should be another dedicated DevServices config property for this. I am thinking it might be nice if the URL parameters would be extracted by default and could be overridden if necessary.

@famod
Copy link
Member

famod commented Mar 11, 2021

/cc @stuartwdouglas

@gsmet maybe "DevServices" should trigger some labels, e.g. area/devmode and area/testing?

@stuartwdouglas
Copy link
Member

There needs to be a dedicated property for this, if devservices is in use then there is no URL to parse (as the presence of a URL will stop devservices starting)

@knutwannheden
Copy link
Contributor Author

There needs to be a dedicated property for this, if devservices is in use then there is no URL to parse (as the presence of a URL will stop devservices starting)

I see. I hadn't quite understood yet that this is how devservices is activated. Thanks for the clarification.

stuartwdouglas added a commit to stuartwdouglas/quarkus that referenced this issue Mar 16, 2021
@quarkus-bot quarkus-bot bot added this to the 1.13 - main milestone Mar 16, 2021
@knutwannheden
Copy link
Contributor Author

As commented on the PR, I believe the implementation for MSSQL needs some minor adjustment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants