From 1d94dbf8e1dbbef35d0cf8c7f45d49d7026b494f Mon Sep 17 00:00:00 2001 From: Odboy Date: Sat, 23 May 2026 21:01:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E4=BB=85=E5=9C=A8?= =?UTF-8?q?=20debug=20=E6=A8=A1=E5=BC=8F=E4=B8=8B=E6=98=BE=E7=A4=BA=20SQL?= =?UTF-8?q?=20=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/internal/dao/engine.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/internal/dao/engine.go b/server/internal/dao/engine.go index 9337701..a032aa1 100644 --- a/server/internal/dao/engine.go +++ b/server/internal/dao/engine.go @@ -6,6 +6,7 @@ import ( "kenaito-conf/server/internal/util" "time" + "github.com/gin-gonic/gin" _ "github.com/go-sql-driver/mysql" "xorm.io/xorm" ) @@ -22,7 +23,10 @@ func Init() error { } Engine.SetMaxOpenConns(20) Engine.SetMaxIdleConns(5) - Engine.ShowSQL(true) + + if config.Cfg.Server.Mode == gin.DebugMode { + Engine.ShowSQL(true) + } // sync table structures if err := Engine.Sync2(