Support MariaDB Native Driver (#2787)

#### What type of PR is this?
/kind improvement


#### What this PR does / why we need it:
引入对R2DBC的MariaDB的支持,增加例子配置

#### Special notes for your reviewer:
现在,Halo可以使用MariaDB数据库原生驱动了,摆脱MySQL驱动带来的连接问题。

- [x] 支持首次启动执行SQL脚本创建表

#### Does this PR introduce a user-facing change?

<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->

```release-note
支持 MariaDB 数据库连接
```
pull/3024/head^2
codychau 2022-12-26 12:02:31 +08:00 committed by GitHub
parent 3601acfa0a
commit fcfc7113f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -92,6 +92,7 @@ dependencies {
// for more. // for more.
runtimeOnly 'io.r2dbc:r2dbc-h2' runtimeOnly 'io.r2dbc:r2dbc-h2'
runtimeOnly 'com.github.jasync-sql:jasync-r2dbc-mysql:2.1.7' runtimeOnly 'com.github.jasync-sql:jasync-r2dbc-mysql:2.1.7'
runtimeOnly 'org.mariadb:r2dbc-mariadb:1.1.3'
runtimeOnly 'org.postgresql:postgresql' runtimeOnly 'org.postgresql:postgresql'
runtimeOnly 'org.postgresql:r2dbc-postgresql' runtimeOnly 'org.postgresql:r2dbc-postgresql'

View File

@ -0,0 +1,9 @@
spring:
r2dbc:
url: r2dbc:pool:mariadb://localhost:3306/halo
username: root
password: mariadb
sql:
init:
mode: always
platform: mysql