db

package
v0.0.0-...-d94bd9c Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMySQL

func NewMySQL(opts *MySQLOptions) (*gorm.DB, error)

NewMySQL 使用给定的选项创建一个新的 gorm 数据库实例

Types

type MySQLOptions

type MySQLOptions struct {
	Host                  string
	UserName              string
	Password              string
	Database              string
	MaxIdleConnections    int
	MaxOpenConnections    int
	MaxConnectionLifeTime time.Duration
	LogLevel              int
}

MySQLOptions 定义 MySQL 数据库的选项

func (*MySQLOptions) DSN

func (o *MySQLOptions) DSN() string

DSN 从 MySQLOptions 返回 DSN

Jump to

Keyboard shortcuts

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