How to avoid tight coupling with a database type? #45664
Closed
shepherd85
started this conversation in
Community
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to build an application with support for multiple backends, using Hibernate and Panache. As it is, Quarkus locks the "db-kind"/"jdbc.driver" configs at build time, effectively producing an application tightly-coupled to a particular backend. I'm really quite stunned that I'm just now learning this, as this is a very common use case - to be database agnostic, and allow users to configure which backend they want to use.
I started trying to implement the example of a CDI producer that returns the "active" DataSource/Session, but Hibernate kept complaining about not having the (default) datasource. So I'll ask here - is there something I'm missing? Is there a sample repo out there that does what I'm looking to do? Why not just unlock these configs? Surely there isn't a technical blocker, other than losing out on some optimizations.
Beta Was this translation helpful? Give feedback.
All reactions