Skip to content

Commit

Permalink
Merge pull request #29894 from gsmet/mariadb-reactive-dev-services
Browse files Browse the repository at this point in the history
Support MariaDB Dev Services in reactive-mysql-client
  • Loading branch information
geoand authored Dec 16, 2022
2 parents 8d40e63 + 69eea65 commit 65f9a18
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ private RunningDevService startDevDb(String dbName,
boolean explicitlyDisabled = !(dataSourceBuildTimeConfig.devservices.enabled.orElse(true));
if (explicitlyDisabled) {
//explicitly disabled
log.debug("Not starting devservices for " + (dbName == null ? "default datasource" : dbName)
+ " as it has been disabled in the config");
log.debug("Not starting Dev Services for " + (dbName == null ? "default datasource" : dbName)
+ " as it has been disabled in the configuration");
return null;
}

Expand All @@ -222,8 +222,8 @@ private RunningDevService startDevDb(String dbName,
List<DevServicesDatasourceConfigurationHandlerBuildItem> configHandlers = configurationHandlerBuildItems
.get(defaultDbKind.get());
if (devDbProvider == null || configHandlers == null) {
log.warn("Unable to start devservices for " + (dbName == null ? "default datasource" : dbName)
+ " as this datasource type (" + defaultDbKind.get() + ") does not support devservices");
log.warn("Unable to start Dev Services for " + (dbName == null ? "default datasource" : dbName)
+ " as this datasource type (" + defaultDbKind.get() + ") does not support Dev Services");
return null;
}

Expand All @@ -232,7 +232,7 @@ private RunningDevService startDevDb(String dbName,
if (i.getCheckConfiguredFunction().test(dbName)) {
//this database has explicit configuration
//we don't start the devservices
log.debug("Not starting devservices for " + (dbName == null ? "default datasource" : dbName)
log.debug("Not starting Dev Services for " + (dbName == null ? "default datasource" : dbName)
+ " as it has explicit configuration");
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public String getEffectiveJdbcUrl() {
}

public String getReactiveUrl() {
return getEffectiveJdbcUrl().replaceFirst("jdbc:", "vertx-reactive:");
return getEffectiveJdbcUrl().replaceFirst("jdbc:mariadb:", "vertx-reactive:mysql:");
}
}
}
4 changes: 4 additions & 0 deletions extensions/reactive-mysql-client/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-devservices-mysql</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-devservices-mariadb</artifactId>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ ServiceStartBuildItem build(BuildProducer<FeatureBuildItem> feature,
}

@BuildStep
DevServicesDatasourceConfigurationHandlerBuildItem devDbHandler() {
return DevServicesDatasourceConfigurationHandlerBuildItem.reactive(DatabaseKind.MYSQL);
List<DevServicesDatasourceConfigurationHandlerBuildItem> devDbHandler() {
return List.of(DevServicesDatasourceConfigurationHandlerBuildItem.reactive(DatabaseKind.MYSQL),
DevServicesDatasourceConfigurationHandlerBuildItem.reactive(DatabaseKind.MARIADB));
}

@BuildStep
Expand Down

0 comments on commit 65f9a18

Please sign in to comment.