question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make quarkus.datasource.db-kind overridable at runtime

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gsmetcommented, Mar 2, 2021

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.

0reactions
maxandersencommented, Nov 28, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found