database

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(c *Config)

Types

type Config

type Config struct {
	UserName string // 数据库用户名
	Password string // 密码
	Host     string // 主机地址
	Port     int    // 端口号
	DbName   string // 数据库名称
	SqlDebug bool   // 是否打印sql语句
}

type Db

type Db = gorm.DB

func GetDb

func GetDb() *Db

func NewDb

func NewDb(c *Config) *Db

InitDb init mysql database connection

Jump to

Keyboard shortcuts

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