Make quarkus.datasource.db-kind overridable at runtime
See original GitHub issueI have an application that uses a relational database and the database type is selected when the application is installed (mysql, mariadb, mssql and oracle). Right now, since the property db-kind
is fixed at build time, I have to compile four different times the same application, one for each database type.
With hibernate the application code is already independent from the implementation, so being able to define the whole data source at runtime would make things easier.
I know it won’t work for the native image, but JIT is totally fine.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Datasources - Quarkus
Generally this will be the db-kind property, although you can also specify Dev Services properties to create named datasources (covered later in this...
Read more >db-kind cannot be overridden from ... - GitHub
quarkus.datasource.db-kind is a build time property, it cannot be set at runtime ... So I should be able to override this property too....
Read more >Configuring data sources in your Quarkus applications
Configure a data source for your Quarkus application using extensions for built-in ... Setting the db-kind property for a data source.
Read more >Datasources - Quarkus
Giving Quarkus the database kind you are targeting will facilitate configuration. By using a JDBC driver extension and setting the kind in the...
Read more >Unable to use external configuration with Quarkus
I'm surprised that quarkus.datasource.db-kind can not be defined at runtime. I usually create an application and allow users to choose between ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah, I asked @iompo to open an issue so that we can gather feedback on this. I explained for now we weren’t considering it.
Reasons why we don’t want to do it is that it then prevents us from doing a lot of the optimizations that makes Quarkus app start up fast in devmode, java vm and native mode. If this was not a build time flag we’ll be back to old approach that makes java apps slow and heavy.
Thus for now if you want to support multiple databases then explicitly configure multiple datasources with appropriate drivers or use reaugmentation.
There is no easy solution here without paying too high a cost for general startup time and memory consumption.
I’m going to close this as wont-fix for now. If new ideas or approaches becomes available a new issue/pr can be made.