mysql

package
v0.0.0-...-0067e11 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(sn string) *gorm.DB

func InitMysql

func InitMysql(configs map[string]MysqlConf) error

func MergeFileds

func MergeFileds(fileds []string, defaultFileds ...string) string

using for select fileds ,when all fields are not required to solve the space is fileds contains "*" it will return *

func MergeFiledsKV

func MergeFiledsKV(args ...any) (string, error)

using for update DML, The args len must even number, first number is key second number is value. key must be string, value is Integer type(see:github.com:joycastle/casual-server-lib/reflect IsIntType()) or string type

Types

type MysqlConf

type MysqlConf struct {
	Addr     string
	Username string
	Password string
	Database string
	Options  string

	MaxIdle     int
	MaxOpen     int
	MaxLifeTime time.Duration

	SlowSqlTime time.Duration

	SlowLogger string
	StatLogger string
}

Jump to

Keyboard shortcuts

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