Hi, today I have been developing a project in Quarkus where I register two data sources, one to be used during dev mode and the other in production:
%dev.quarkus.datasource.db-kind=h2
%dev.quarkus.datasource.username=sa
%dev.quarkus.datasource.password=
%dev.quarkus.datasource.jdbc.url=jdbc:h2:mem:todo
quarkus.datasource.db-kind=postgresql
quarkus.datasource.username=root
quarkus.datasource.jdbc.url=jdbc:postgresql://cockroachdb-public:26257/todo
When I start the application in dev mode, I can see that both drivers extension are registered and started:
021-01-14 13:45:42,932 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [agroal, cdi, hibernate-orm, hibernate-orm-panache, jdbc-h2, jdbc-postgresql, mutiny, narayana-jta, resteasy, resteasy-jsonb, smallrye-context-propagation, smallrye-graphql, smallrye-openapi, swagger-ui]
In dev mode it is not a big issue, but in other modes it might be an issue (thinking in terms of memory or security). Would it be any way to detect this and not load the drivers that are not used?
Thanks.