checkmigration

package
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMigrate

func CheckMigrate(db *gorm.DB, objects []interface{}) []string

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

func (*CustomLogger) Trace

func (c *CustomLogger) Trace(_ context.Context, begin time.Time, fc func() (string, int64), err error)

func (*CustomLogger) Warn

func (c *CustomLogger) Warn(_ context.Context, msg string, data ...interface{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL