The highest tagged major version is
v3 .
Discover Packages
github.com/richelieu-yang/chimera/v2
src
database
mysqlKit
package
Version:
v2.1.31
Opens a new window with list of versions in this module.
Published: Jul 12, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 13
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
CreateDatabaseIfNotExists 自动创建数据库
在 Go 项目中优雅的使用 gorm v2
https://segmentfault.com/a/1190000039097157
SetUp
@param output 客户端的日志输出(nil: 输出到控制台)
type DsnConfig struct {
UserName string `json:"userName"`
Password string `json:"password,optional"`
Host string `json:"host"`
DBName string `json:"dbName"`
}
type LogConfig struct {
SlowThreshold time .Duration `json:"slowThreshold,default=200ms"`
LogLevel logger .LogLevel `json:"logLevel,default=4,options=1|2|3|4"`
}
type PoolConfig struct {
MaxIdleConns int `json:"maxIdleConns,default=32"`
MaxOpenConns int `json:"maxOpenConns,default=128"`
ConnMaxLifetime time .Duration `json:"connMaxLifetime,default=30m"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.