feat(schema): 添加基础混入定义公共时间字段
This commit is contained in:
1 parent
5281459fcb
commit
fe86c081f4
16 files changed
+1715
-14
No files matched your search
@@ -24,6 +24,11 @@ func Init(driver string, dsn string) error {
|
||||
return fmt.Errorf("打开数据库连接失败 [%s]: %w", driver, err)
|
||||
}
|
||||
|
||||
// 立即 Ping 数据库,验证账号密码及数据库是否存在
|
||||
if err := db.Ping(); err != nil {
|
||||
return fmt.Errorf("无法连接至数据库 [%s],请检查账号密码或数据库是否存在: %w", driver, err)
|
||||
}
|
||||
|
||||
// 连接池设置
|
||||
db.SetMaxIdleConns(10)
|
||||
db.SetMaxOpenConns(100)
|
||||
|
||||
Reference in new issue
Block a user