File tree Expand file tree Collapse file tree 1 file changed +18
-12
lines changed
server/model/system/request Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -43,24 +43,30 @@ func (i *InitDB) PgsqlEmptyDsn() string {
43
43
// Author [SliverHorn](https://github.com/SliverHorn)
44
44
func (i * InitDB ) ToMysqlConfig () config.Mysql {
45
45
return config.Mysql {
46
- Path : i .Host ,
47
- Port : i .Port ,
48
- Dbname : i .DBName ,
49
- Username : i .UserName ,
50
- Password : i .Password ,
51
- Config : "charset=utf8mb4&parseTime=True&loc=Local" ,
46
+ Path : i .Host ,
47
+ Port : i .Port ,
48
+ Dbname : i .DBName ,
49
+ Username : i .UserName ,
50
+ Password : i .Password ,
51
+ MaxIdleConns : 10 ,
52
+ MaxOpenConns : 100 ,
53
+ LogMode : "error" ,
54
+ Config : "charset=utf8mb4&parseTime=True&loc=Local" ,
52
55
}
53
56
}
54
57
55
58
// ToPgsqlConfig 转换 config.Pgsql
56
59
// Author [SliverHorn](https://github.com/SliverHorn)
57
60
func (i * InitDB ) ToPgsqlConfig () config.Pgsql {
58
61
return config.Pgsql {
59
- Path : i .Host ,
60
- Port : i .Port ,
61
- Dbname : i .DBName ,
62
- Username : i .UserName ,
63
- Password : i .Password ,
64
- Config : "sslmode=disable TimeZone=Asia/Shanghai" ,
62
+ Path : i .Host ,
63
+ Port : i .Port ,
64
+ Dbname : i .DBName ,
65
+ Username : i .UserName ,
66
+ Password : i .Password ,
67
+ MaxIdleConns : 10 ,
68
+ MaxOpenConns : 100 ,
69
+ LogMode : "error" ,
70
+ Config : "sslmode=disable TimeZone=Asia/Shanghai" ,
65
71
}
66
72
}
You can’t perform that action at this time.
0 commit comments