From e0b2b4649e167350064ff5a8c5e37bb945763981 Mon Sep 17 00:00:00 2001 From: Anye <53684988+Anyexyz@users.noreply.github.com> Date: Mon, 30 Jun 2025 19:32:21 +0800 Subject: [PATCH] fix(db): map MariaDB type to MySQL (#2587) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(db): 将MariaDB数据库类型映射到MySQL类型 * Update client.go --- inventory/client.go | 3 +++ pkg/conf/types.go | 1 + 2 files changed, 4 insertions(+) diff --git a/inventory/client.go b/inventory/client.go index bbbee4b..7f342ab 100644 --- a/inventory/client.go +++ b/inventory/client.go @@ -52,6 +52,9 @@ func NewRawEntClient(l logging.Logger, config conf.ConfigProvider) (*ent.Client, if confDBType == conf.SQLite3DB || confDBType == "" { confDBType = conf.SQLiteDB } + if confDBType == conf.MariaDB { + confDBType = conf.MySqlDB + } var ( err error diff --git a/pkg/conf/types.go b/pkg/conf/types.go index 285278f..e5a53b4 100644 --- a/pkg/conf/types.go +++ b/pkg/conf/types.go @@ -10,6 +10,7 @@ var ( MySqlDB DBType = "mysql" MsSqlDB DBType = "mssql" PostgresDB DBType = "postgres" + MariaDB DBType = "mariadb" ) // Database 数据库