quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.73k stars 2.67k forks source link

Unable to start devservices for MariaDB #29891

Closed oaklandcorp-jkaiser closed 1 year ago

oaklandcorp-jkaiser commented 1 year ago

Describe the bug

The Dev Services for Databases guide suggests that MariaDB has dev services available but I've been unable to get them working. When I use the config quarkus.datasource.db-kind=mariadb I'm unable to start database dev services. An issue on StackOverflow seems to have discovered the same issue I'm having back in Quarkus 2.4.

Expected behavior

When using quarkus.datasource.db-kind=mariadb and quarkus.datasource.devservices=true the MariaDB TestContainer should be started when dev mode or tests are run.

Actual behavior

Unable to start devservices for default datasource as this datasource type (mariadb) does not support devservices

How to Reproduce?

  1. Use https://code.quarkus.io/ to create a project with Hibernate Rx
  2. Add quarkus.datasource.db-kind=mariadb to application.properties
  3. Run ./mvnw quarkus:dev

Output of uname -a or ver

Linux 5.15.0-56-generic

Output of java -version

openjdk version "17.0.4"

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.15.0

Build tool (ie. output of mvnw --version or gradlew --version)

3.8.6

Additional information

No response

quarkus-bot[bot] commented 1 year ago

/cc @geoand(devservices), @stuartwdouglas(devservices)

gsmet commented 1 year ago

This is specific to using the Reactive stack. We don't promote the MariaDB dev service for reactive as we don't have an actual MariaDB reactive driver.

My understanding is that the Reactive MySQL Client supports both MySQL and MariaDB so we should make it work.

https://vertx.io/docs/vertx-mysql-client/java/#_mysql_and_mariadb_version_support_matrix

I'll go do that.

gsmet commented 1 year ago

https://github.com/quarkusio/quarkus/pull/29894 should fix it.

oaklandcorp-jkaiser commented 1 year ago

This is specific to using the Reactive stack. We don't promote the MariaDB dev service for reactive as we don't have an actual MariaDB reactive driver.

My understanding is that the Reactive MySQL Client supports both MySQL and MariaDB so we should make it work.

https://vertx.io/docs/vertx-mysql-client/java/#_mysql_and_mariadb_version_support_matrix

I'll go do that.

That all makes sense. Thanks for the quick response and proposed fix!

After recently discovering the power of dev services I've been trying to use them more in my development process. In other projects I've used org.testcontainers.mariadb directly in a QuarkusTestResourceLifecycleManager to include MariaDB containers in testing. That approach works fairly well for automated testing and doesn't require a ton of boilerplate but since dev services seems to be doing something similar under the seams it would be nicer if it could handle it. Plus then the application has the added bonus of using that container for dev mode testing and automated testing.