3

I'm looking for a way to easily deal with a lot of data sources in Quarkus without having to specify them in the application.propertie file.

My problem is really easy to understand. I have a lot of sqlite database (for some reasons that i will not explain here because it's not related to my problem) and i have an endpoint like this

/name-of-my-sqlite-database/table/id (the endpoint list all column in the table "table" from database "name-of-my-sqlite-database")

and i would like to be able to open a connection to the "name-of-my-sqlite-database.db" stored locally.

So, if i create or copy/paste a second sqlite database named "db2", i need to open the "db2.db" database.

With Quarkus, i understood the really easy way to specify information in the application.propertie file, but in my case, it's a little bit different and i would enjoy to know if there is an easy way to do this ? Or if i need to do everything by myself ? but i will loose all the magic of Quarkus...

Thank you guys.

jojal
  • 67
  • 5

1 Answers1

0

There is currently no way to do this out of the box in Quarkus. You could write an extension to do that if you really need the feature and are willing to dive into Quarkus internals.

geoand
  • 60,071
  • 24
  • 172
  • 190
  • Thank you for your answer. It would be a great exercice to try to write this extension. Sorry to ask, but could you maybe give me a 1 or 2 tips in order to start in a good way ? I looked into the Quarkus website how to write my current extension, but it's a some generics examples not really close to my needs. – jojal Jan 03 '20 at 02:15
  • There is a Pull Request in progress with some good information: https://github.com/quarkusio/quarkus/pull/2406 – geoand Jan 03 '20 at 11:27