From ebcafe6117923fee5e56a89344231bcf4b042218 Mon Sep 17 00:00:00 2001 From: John Niang Date: Wed, 31 May 2023 14:41:03 +0800 Subject: [PATCH] Replace R2DBC MySQL driver to io.asyncer:r2dbc-mysql (#3918) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind improvement /area core #### What this PR does / why we need it: Replace R2DBC MySQL driver to io.asyncer:r2dbc-mysql. See https://github.com/halo-dev/halo/issues/3804 for more. Please note that there will be an error like below when starting up Halo on MacOS: ```java 2023-05-09T14:24:45.161+08:00 ERROR 4668 --- [ restartedMain] i.n.r.d.DnsServerAddressStreamProviders : Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS. Check whether you have a dependency on 'io.netty:netty-resolver-dns-native-macos'. Use DEBUG level to see the full stack: java.lang.UnsatisfiedLinkError: failed to load the required native library ``` After manual test, I haven't found any problems caused by the error. And this only occurs on MacOS when developing. #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3804 #### Special notes for your reviewer: Steps to test: 1. Start up a MySQL server, e.g.: ```bash docker run -it --rm --name halodb -p 3306:3306 -e MYSQL_ROOT_PASSWORD=openmysql -e MYSQL_DATABASE=halo mysql:8 ``` 3. Start Halo with mysql profile active ```bash make -C console dev ./gradlew bootRun --args="--spring.profiles.active=dev,mysql --halo.plugin.runtime-mode=deployment" ``` 5. Check the functionality of Halo #### Does this PR introduce a user-facing change? ```release-note 替换 R2DBC MySQL 驱动为:io.asyncer:r2dbc-mysql ``` --- api/build.gradle | 2 +- gradle.properties | 1 + platform/application/build.gradle | 4 ---- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/api/build.gradle b/api/build.gradle index c6b691aed..1e262927f 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -54,7 +54,7 @@ dependencies { runtimeOnly 'org.postgresql:postgresql' runtimeOnly 'org.postgresql:r2dbc-postgresql' runtimeOnly 'org.mariadb:r2dbc-mariadb' - runtimeOnly 'com.github.jasync-sql:jasync-r2dbc-mysql' + runtimeOnly 'io.asyncer:r2dbc-mysql' testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.security:spring-security-test' diff --git a/gradle.properties b/gradle.properties index 29b6902bc..f08c9f921 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,2 @@ version=2.6.0-SNAPSHOT +r2dbc-mysql.version=1.0.2 diff --git a/platform/application/build.gradle b/platform/application/build.gradle index 20e62c69d..9434fd6e2 100644 --- a/platform/application/build.gradle +++ b/platform/application/build.gradle @@ -50,11 +50,7 @@ dependencies { api "com.github.java-json-tools:json-patch:$jsonPatch" api "org.thymeleaf.extras:thymeleaf-extras-springsecurity6" - runtime 'io.r2dbc:r2dbc-h2' - runtime 'org.postgresql:postgresql' - runtime 'org.postgresql:r2dbc-postgresql' runtime 'org.mariadb:r2dbc-mariadb:1.1.4' - runtime 'com.github.jasync-sql:jasync-r2dbc-mysql:2.1.23' } }