mysql

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

Close db.

func GetDB

func GetDB() *gorm.DB

func InitDB

func InitDB(opts ...Option) error

func NewMySQL

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

Types

type Option

type Option func(*option)

func Addr

func Addr(addr string) Option

func ConnMaxLifetime

func ConnMaxLifetime(d time.Duration) Option

func DBName

func DBName(db string) Option

func DSN

func DSN(dsn string) Option

func Debug

func Debug(b bool) Option

func IdleTimeout

func IdleTimeout(d time.Duration) Option

func MaxConns

func MaxConns(i int) Option

func MaxIdleConns

func MaxIdleConns(i int) Option

func Password

func Password(password string) Option

func User

func User(user string) Option

func WithConfig

func WithConfig(cfg *configv1.MySQL) Option

Jump to

Keyboard shortcuts

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