Skip to content

Commit d601469

Browse files
author
piexlmax
committed
修复log-mode失效的问题
1 parent 7452829 commit d601469

File tree

5 files changed

+87
-6
lines changed

5 files changed

+87
-6
lines changed

server/config/gorm_mysql.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ type Mysql struct {
1616
func (m *Mysql) Dsn() string {
1717
return m.Username + ":" + m.Password + "@tcp(" + m.Path + ":" + m.Port + ")/" + m.Dbname + "?" + m.Config
1818
}
19+
20+
func (m *Mysql) GetLogMode() string {
21+
return m.LogMode
22+
}

server/config/gorm_pgsql.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ func (p *Pgsql) Dsn() string {
2424
func (p *Pgsql) LinkDsn(dbname string) string {
2525
return "host=" + p.Path + " user=" + p.Username + " password=" + p.Password + " dbname=" + dbname + " port=" + p.Port + " " + p.Config
2626
}
27+
28+
func (m *Pgsql) GetLogMode() string {
29+
return m.LogMode
30+
}

server/go.mod

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ require (
1919
github.com/gofrs/uuid v3.2.0+incompatible
2020
github.com/gookit/color v1.3.1
2121
github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.8+incompatible
22+
github.com/jackc/pgx/v4 v4.15.0 // indirect
2223
github.com/jordan-wright/email v0.0.0-20200824153738-3f5bafa1cd84
2324
github.com/mojocn/base64Captcha v1.3.1
2425
github.com/natefinch/lumberjack v2.0.0+incompatible
@@ -37,10 +38,11 @@ require (
3738
github.com/unrolled/secure v1.0.7
3839
github.com/xuri/excelize/v2 v2.4.1
3940
go.uber.org/zap v1.16.0
41+
golang.org/x/crypto v0.0.0-20220213190939-1e6e3497d506 // indirect
4042
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
4143
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
4244
gorm.io/driver/mysql v1.0.1
43-
gorm.io/driver/postgres v0.2.6
44-
gorm.io/gorm v1.20.11
45+
gorm.io/driver/postgres v1.2.3
46+
gorm.io/gorm v1.22.5
4547
nhooyr.io/websocket v1.8.6
4648
)

0 commit comments

Comments
 (0)