mysql

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EqualPredicate              = Predicate("=")
	NotEqualPredicate           = Predicate("<>")
	GreaterThanPredicate        = Predicate(">")
	GreaterThanOrEqualPredicate = Predicate(">=")
	SmallerThanPredicate        = Predicate("<")
	SmallerThanOrEqualPredicate = Predicate("<=")
	LikePredicate               = Predicate("LIKE")
)

Functions

This section is empty.

Types

type MySqlConfig

type MySqlConfig struct {
	// MySqlHost       `yaml:",inline"` // inline has no effect for inherit, seems that yaml is ok
	Addr            string        `yaml:"addr"`
	Username        string        `yaml:"username"`
	Password        string        `yaml:"password"`
	Db              string        `yaml:"db"`
	MaxOpenConn     int           `yaml:"maxOpenConn"`
	MaxIdleConn     int           `yaml:"maxIdleConn"`
	ConnMaxLifeTime time.Duration `yaml:"connMaxLifeTime"`
}

type Predicate

type Predicate string

Predicate is a string that acts as a condition in the where clause

type Repo

type Repo interface {
	GetDb() *gorm.DB
	DbClose() error
	// contains filtered or unexported methods
}

func New

func New(cfg *MySqlConfig, logger *zap.Logger) (Repo, error)

type TracePlugin

type TracePlugin struct{}

func (*TracePlugin) Initialize

func (op *TracePlugin) Initialize(db *gorm.DB) (err error)

func (*TracePlugin) Name

func (op *TracePlugin) Name() string

Jump to

Keyboard shortcuts

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