mysql

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetORM

func GetORM() *gorm.DB

GetORM return default *gorm.DB

func GetORMByName

func GetORMByName(name string) *gorm.DB

GetORMByName get orm by name

func InitDB

func InitDB(list []*DBConfig) (err error)

InitDB init multiple db

func InitDefaultDB

func InitDefaultDB(db *DBConfig) (err error)

InitDefaultDB init single db config

Types

type DBConfig

type DBConfig struct {
	Name            string //库名
	User            string //登录名
	Password        string //密码
	Host            string //主机
	Port            int    //port
	Debug           bool   //是否debug
	DisablePrepared bool   //是否disable prepared
}

DBConfig mysql配置文件

Jump to

Keyboard shortcuts

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