dblink

package
v0.0.0-...-72396ee Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBoption

type DBoption func(md *MysqlAccess)

DBoption MysqlAccess的设置器

func SetMysqlAccessByConfig

func SetMysqlAccessByConfig(cfg *global.MysqlConfig) DBoption

SetMysqlAccessByConfig 设置数据库的连接字符串

type GormConfig

type GormConfig struct {
	//慢查询时间
	SlowThreshold time.Duration
}

func (*GormConfig) AfterInitialize

func (cfg *GormConfig) AfterInitialize(v *gorm.DB) error

func (*GormConfig) Apply

func (cfg *GormConfig) Apply(v *gorm.Config) error

func (*GormConfig) Error

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

func (*GormConfig) Info

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

func (*GormConfig) LogMode

func (*GormConfig) Trace

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

func (*GormConfig) Warn

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

type MysqlAccess

type MysqlAccess struct {
	gorm.DB
	Config global.MysqlConfig
}

MysqlAccess Mysql连接科器

func NewMysqlAccess

func NewMysqlAccess(opts ...DBoption) *MysqlAccess

NewMysqlAccess 生成一个连接器

Jump to

Keyboard shortcuts

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