quarkiverse / quarkus-jdbi

Jdbi provides convenient, idiomatic access to relational data in Java
https://jdbi.org/
Apache License 2.0
13 stars 4 forks source link

Introduce support for Repository recognition in Quarkus #90

Open ghost opened 7 months ago

ghost commented 7 months ago

There is a JdbiRepository annotation that adheres to certain conventions within the Spring ecosystem — but it's only available within org.jdbi:jdbi3-spring5 😬

It's not clear to me yet how this may work internally —in regard of the type of handle that it uses and how transactions are handled—, but when using SQL objects is extremely convenient to have such functionality because it applies the correct abstraction without the intervention of developers. These repositories are available for injection when @JdbiRepository is used, so the framework (Spring) creates the instances for each of them.

Could it be possible to implement something similar in this extension?

I think this feature will align Jdbi more closely with the simplicity and convenience provided by Quarkus, reducing boilerplate code and improving the overall developer experience.

smil2k commented 7 months ago

I cannot agree more. #12 and #9 is just about what you just mentioned. They are on the road map, but no time line.

Making such support is rather simple and fun. Quarkus has a wonderful SPI, it is very easy to find interfaces with a given annotation or whether a certain type of class is registered already into the context. Bulk of this code were made in two days!