diff --git a/framework/config/config.go b/framework/config/config.go index 5b5f628d..9f590266 100644 --- a/framework/config/config.go +++ b/framework/config/config.go @@ -541,6 +541,7 @@ type Config struct { Postgres struct { PreferSimpleProtocol bool WithoutReturning bool + WithoutQuotingCheck bool } Pool struct { MaxIdleConns int `default:"2"` diff --git a/framework/database/database.go b/framework/database/database.go index d2500e11..1ecfafe8 100644 --- a/framework/database/database.go +++ b/framework/database/database.go @@ -235,6 +235,7 @@ func NewDb(conf config.Config) (db *gorm.DB) { DSN: dsn, PreferSimpleProtocol: conf.Db.Postgres.PreferSimpleProtocol, WithoutReturning: conf.Db.Postgres.WithoutReturning, + WithoutQuotingCheck: conf.Db.Postgres.WithoutQuotingCheck, } db, err = gorm.Open(postgres.New(conf), gormConf) case DriverSqlite: diff --git a/go.mod b/go.mod index a58aaa26..38196f33 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( github.com/uber/jaeger-lib v2.4.1+incompatible github.com/unionj-cloud/toolkit v0.0.2 github.com/wubin1989/dbresolver v0.0.2 // indirect - github.com/wubin1989/gen v0.0.4-0.20241120013357-f04cfd0a13ff + github.com/wubin1989/gen v0.0.4 github.com/wubin1989/gorm v0.0.5 golang.org/x/tools v0.26.0 // indirect ) diff --git a/go.sum b/go.sum index 6dfef1e0..3098773b 100644 --- a/go.sum +++ b/go.sum @@ -1670,8 +1670,8 @@ github.com/wubin1989/datatypes v0.0.2 h1:a2ZiuWjqiYHRS+lkvan8QymxYtB1yvwJHf0kE7m github.com/wubin1989/datatypes v0.0.2/go.mod h1:ifZrSL9ZeEfOqWxCvAx6ugbiMYcMPRyY2mSgN8qRdKE= github.com/wubin1989/dbresolver v0.0.2 h1:nxZJa7TSPRWvrHyshbBhoiHFt3/cagHi1qOySrCyqjE= github.com/wubin1989/dbresolver v0.0.2/go.mod h1:QCzD3CTzNXQ8Vk/V0WRdCQw2Mu8d/UGa3AyRIbbe9hc= -github.com/wubin1989/gen v0.0.4-0.20241120013357-f04cfd0a13ff h1:Zf86px+UxXbMXkRctTz4Fz+hUo4kt3zxoUH/bhQ8ht4= -github.com/wubin1989/gen v0.0.4-0.20241120013357-f04cfd0a13ff/go.mod h1:G4p5Jd41IKqHUyszLXt3eJI9nZyzB0XeFZWL3XaAgJU= +github.com/wubin1989/gen v0.0.4 h1:anmAYD1RYAXtzcPRaY9rnvVD7C6W9bEq5Wja/b6803I= +github.com/wubin1989/gen v0.0.4/go.mod h1:G4p5Jd41IKqHUyszLXt3eJI9nZyzB0XeFZWL3XaAgJU= github.com/wubin1989/gorm v0.0.3/go.mod h1:sv3afa8/Q6XTgEbTTWTjJd0NIlBMH4bMq5VpEnXr/Cc= github.com/wubin1989/gorm v0.0.5 h1:eI+zjoQ2GEURnPBEh+H4axSD4sM0wWpJCAQZw+FfZX8= github.com/wubin1989/gorm v0.0.5/go.mod h1:q/wDV7AJMsbDdtv+K3eNX+VMpC0k1uxCqPBPXzHO90k=