Help us shape the future of Go! Take the 2026 Go Developer Survey

mysql

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustNewDB added in v1.7.3

func MustNewDB(cfg Config, logger logger.Interface) *gorm.DB

MustNewDB 获取数据库连接,如果失败则 panic。

func NewDB

func NewDB(cfg Config, logger logger.Interface) (*gorm.DB, error)

NewDB 获取数据库连接

Types

type Config

type Config struct {
	Dsn    string
	Prefix string
}

Config MySQL 连接配置

Jump to

Keyboard shortcuts

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