Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyQueryOpts ¶
func ApplyQueryOpts(db *gorm.DB, opts ...QueryOptFunc) *gorm.DB
func InitMySql ¶
func InitMySql(c *MySqlConfig)
Types ¶
type FuncOpts ¶
type FuncOpts func(l *customizedLogger)
func WithLogLevel ¶
func WithLogger ¶
func WithRecordNotFound ¶
func WithSlowThreshold ¶
type MySqlConfig ¶
type MySqlConfig struct { Address string `json:"address"` MaxIdleConn int `json:"max_idle_conn"` MaxOpenConn int `json:"max_open_conn"` MaxLifeTime int `json:"max_life_time"` MaxIdleTime int `json:"max_idle_time"` LogMode int `json:"log_mode"` //默认warn CustomizedLog bool `json:"customized_log"` xlogger.Logger }
type QueryOptFunc ¶
type QueryOptFunc func(*QueryOption)
func Limit ¶
func Limit(limit int) QueryOptFunc
func Order ¶
func Order(order ...string) QueryOptFunc
func Skip ¶
func Skip(skip int) QueryOptFunc
type QueryOption ¶
Click to show internal directories.
Click to hide internal directories.