Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoRow = sql.ErrNoRows ErrRecordNotFound = gorm.ErrRecordNotFound )
Functions ¶
func InitGormV2 ¶
func InitGormV2(c *MySQLConfig) (db *gorm.DB)
Types ¶
type MySQLConfig ¶
type MySQLConfig struct {
DSN string // data source name.
MaxOpenConn int // pool, e.g:10
MaxIdleConn int // pool, e.g:100
MaxConnTimeout xtime.Duration // connect max life time. e.g:10s、2m、1m10s
LogLevel logger.LogLevel // Silent、Info、Warn、Error, default Warn
SlowThreshold xtime.Duration // slow sql log. e.g:100ms、200ms、300ms、1s, default 200ms
}
MySQLConfig mysql config.
Click to show internal directories.
Click to hide internal directories.