Documentation
¶
Index ¶
- func CheckMigrate(db *gorm.DB, objects []interface{}) []string
- type CustomLogger
- func (c *CustomLogger) Error(_ context.Context, msg string, data ...interface{})
- func (c *CustomLogger) Info(_ context.Context, msg string, data ...interface{})
- func (c *CustomLogger) LogMode(level logger.LogLevel) logger.Interface
- func (c *CustomLogger) Trace(_ context.Context, begin time.Time, fc func() (string, int64), err error)
- func (c *CustomLogger) Warn(_ context.Context, msg string, data ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMigrate ¶
CheckMigrate 这个函数用来对比DB和模型,检查DB里缺少什么没有执行的语句
Types ¶
type CustomLogger ¶
type CustomLogger struct {
SQLs []string
}
CustomLogger 自定义 Logger 捕获执行过的 SQL 语句
func (*CustomLogger) Error ¶
func (c *CustomLogger) Error(_ context.Context, msg string, data ...interface{})
func (*CustomLogger) Info ¶
func (c *CustomLogger) Info(_ context.Context, msg string, data ...interface{})
func (*CustomLogger) LogMode ¶
func (c *CustomLogger) LogMode(level logger.LogLevel) logger.Interface
Click to show internal directories.
Click to hide internal directories.