mysql

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(name string) *gorm.DB

func Main

func Main() *gorm.DB

Main 获取名为"main"的连接

Types

type Instance

type Instance struct {
}

func (*Instance) GetName

func (i *Instance) GetName() string

func (*Instance) Load

func (i *Instance) Load() error

type Logger

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

Logger 实现了gorm.io logger接口

func New

func New(zl zerolog.Logger, config gormlogger.Config) *Logger

New Logger构造函数

func (*Logger) Error

func (l *Logger) Error(ctx context.Context, s string, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(ctx context.Context, s string, args ...interface{})

func (*Logger) LogMode

func (*Logger) Trace

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

func (*Logger) Warn

func (l *Logger) Warn(ctx context.Context, s string, args ...interface{})

Jump to

Keyboard shortcuts

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