diff --git a/common/config/config.dev.yaml b/common/config/config.dev.yaml index 78d8f83..07c7228 100644 --- a/common/config/config.dev.yaml +++ b/common/config/config.dev.yaml @@ -15,7 +15,7 @@ rpc: # pgSql pgSql: logSql: true - dsn: postgres://postgres:zym520!@123.207.198.132:15432/mylomen_user?charset=utf8&parseTime=True&loc=Local + dsn: postgres://postgres:zym520!@123.207.198.132:15432/mylomen_user maxIdleConn: 4 maxOpenConn: 4 connMaxLifetime: 0 diff --git a/common/config/config.prod.yaml b/common/config/config.prod.yaml index ceabbc1..5c4bb4a 100644 --- a/common/config/config.prod.yaml +++ b/common/config/config.prod.yaml @@ -15,7 +15,7 @@ rpc: # pgSql pgSql: logSql: false - dsn: postgres://postgres:zym520!@10.0.12.8:15432/mylomen_user?charset=utf8&parseTime=True&loc=Local + dsn: postgres://postgres:zym520!@10.0.12.8:15432/mylomen_user maxIdleConn: 30 maxOpenConn: 30 connMaxLifetime: 0 diff --git a/infrastructure/repository/as_db_pg_test.go b/infrastructure/repository/as_db_pg_test.go index 8c8293f..74a957e 100644 --- a/infrastructure/repository/as_db_pg_test.go +++ b/infrastructure/repository/as_db_pg_test.go @@ -33,7 +33,7 @@ func TestPg(t *testing.T) { } var total int - db.Raw("select max(id) from test").Scan(&total) + db.Raw("select max(id) from user").Scan(&total) // 打印成功信息 fmt.Println("连接数据库成功", total)