This commit is contained in:
shaoyongjun 2024-09-29 21:14:52 +08:00
parent 43d28c5500
commit 41b609c783
3 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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)