mysql

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() libs.GDB

New 创建mysql实例

Types

type DB

type DB struct {
	LogFile  string `json:"log_file" json:"log_file"`
	LogLevel string `json:"log_level" yaml:"log_level"`

	Host     string `json:"host" yaml:"host"`
	Port     string `json:"port" yaml:"port"`
	DBName   string `json:"dbname" yaml:"dbname"`
	UserName string `json:"username" yaml:"username"`
	Password string `json:"password" yaml:"password"`

	MaxIdleTime int `json:"max_idle_time" yaml:"max_idle_time"`
	MaxLifeTime int `json:"max_life_time" yaml:"max_life_time"`
	MaxOpenConn int `json:"max_open_conn" yaml:"max_open_conn"`
	MaxIdleConn int `json:"max_idle_conn" yaml:"max_idle_conn"`
	// contains filtered or unexported fields
}

DB mysql实例

func (*DB) Client

func (this *DB) Client() *gorm.DB

Client 获取数据库连接

func (*DB) Conn

func (this *DB) Conn() error

Conn 连接数据库

Jump to

Keyboard shortcuts

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