mysql

package module
v0.0.0-...-f802b22 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(name string) *gorm.DB

Get 获取指定mysql实例

func Main

func Main() *gorm.DB

Types

type Instance

type Instance struct {
	Items map[string]item `json:"items"` // 组件可能有多个实例,要想把多个配置项解析到items,需要在配置文件增加一层,名为items
}

func (*Instance) Name

func (i *Instance) Name() string

func (*Instance) Run

func (i *Instance) Run() error

func (*Instance) UpdateInternalLogger

func (i *Instance) UpdateInternalLogger()

UpdateInternalLogger 更新内部Logger,应当在logk更换Logger后调用

type SqlLogger

type SqlLogger struct {
	gormlogger.Config
	// contains filtered or unexported fields
}

func New

func New(kLog logk.Logger, cf gormlogger.Config) *SqlLogger

func (*SqlLogger) Error

func (l *SqlLogger) Error(ctx context.Context, msg string, data ...interface{})

func (*SqlLogger) Info

func (l *SqlLogger) Info(ctx context.Context, msg string, data ...interface{})

func (*SqlLogger) LogMode

func (l *SqlLogger) LogMode(level gormlogger.LogLevel) gormlogger.Interface

func (*SqlLogger) Trace

func (l *SqlLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

func (*SqlLogger) Warn

func (l *SqlLogger) Warn(ctx context.Context, msg string, data ...interface{})

Jump to

Keyboard shortcuts

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