Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use this extension with a database managed by Quarks Dev Services #173

Closed
jorgebsa opened this issue Jan 17, 2022 · 5 comments · Fixed by #175
Closed

How to use this extension with a database managed by Quarks Dev Services #173

jorgebsa opened this issue Jan 17, 2022 · 5 comments · Fixed by #175

Comments

@jorgebsa
Copy link

In the Quarkus example implementation of the DataSourceProvider you make it clear that it's not possible to interact with Quarkus at that point in order to get the connection string directly from ConfigProvider.getConfig(), so you rely on reading the application.properties file with the help of SmallRyeConfigBuilder.

My question is: since the value of quarkus.datasource.jdbc.url is purposely omitted from the file in order to have the DB launched by Dev Service during test, how would you be able to get the connection details in order to implement a DataSourceProvider ?

There's probably a way of doing so, but I'm quite new to the Quarkus world so I'm not aware. Really need this for my integration tests, or else I will have to rely on dropping and populating everything manually for each test, which is quite tedious and error-prone

@radcortez
Copy link
Owner

DevServices were added after I wrote this extension, so I never fully integrated them. The plan was to bring in this extension natively into Quarkus, but I haven't got the time to do it: quarkusio/quarkus#14240

Anyway, let me see if I can at least come up with something to integrate with DevServices.

@jorgebsa
Copy link
Author

Totally understandable :) here's to hoping you are able to figure something in order to make it work with dev services haha

@radcortez
Copy link
Owner

Hi @jorgebsa, check #175 on how to do it.

@jorgebsa
Copy link
Author

will try it out later, much appreciated 🥳

@jorgebsa
Copy link
Author

jorgebsa commented Jan 26, 2022

Just to let you know, I've just tested it against Quarkus 2.6.3 and it works as expected :) thank you so much for implementing the solution so quickly, much appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants