mysql

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DBClient 全局DB客户端
	DBClient *gorm.DB
)

Functions

This section is empty.

Types

type BasicModel

type BasicModel struct {
	gorm.Model
	CreatedUser string `gorm:"column:created_user" json:"created_user"`
	UpdatedUser string `gorm:"column:updated_user" json:"updated_user"`
	DeletedUser string `gorm:"column:deleted_user" json:"deleted_user"`
}

BasicModel 基础模型

type GenerateDSNParam

type GenerateDSNParam struct {
	DbHost string `json:"db_host"` // DbHost 数据库服务host
	DbPort int    `json:"db_port"` // DbPort 数据库服务port
	DbUser string `json:"db_user"` // DbUser 数据库服务用户名
	DbPwd  string `json:"db_pwd"`  // DbPwd 数据库服务密码
	DbName string `json:"db_name"` // DbName 数据库名
}

GenerateDSNParam 生成dsn参数

func (*GenerateDSNParam) GenerateDSN

func (h *GenerateDSNParam) GenerateDSN() string

GenerateDSN dsn

func (*GenerateDSNParam) InitDB

func (h *GenerateDSNParam) InitDB()

InitDB 初始化DB连接

Jump to

Keyboard shortcuts

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