新增postgresql的Host配置

This commit is contained in:
SliverHorn
2020-09-22 17:53:20 +08:00
parent 9e19684d40
commit f8e1832172
2 changed files with 2 additions and 1 deletions

View File

@@ -82,7 +82,7 @@ func GormMysql() {
// GormPostgreSql 初始化PostgreSql数据库
func GormPostgreSql() {
p := global.GVA_CONFIG.Postgresql
dsn := "user=" + p.Username + " password=" + p.Password + " dbname=" + p.Dbname + " port=" + p.Port + " " + p.Config
dsn := "host="+ p.Host + " user=" + p.Username + " password=" + p.Password + " dbname=" + p.Dbname + " port=" + p.Port + " " + p.Config
postgresConfig := postgres.Config{
DSN: dsn, // DSN data source name
PreferSimpleProtocol: p.PreferSimpleProtocol, // 禁用隐式 prepared statement