datasource

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDbInstance

func GetDbInstance() (*gorm.DB, error)

GetDbInstance 多个协程在使用公用_db调用其他方法时,会从连接池中获取连接

func GormInit

func GormInit(pg *PostgresConfig, models []interface{}) (err error)

GormInit 初始化配置 pg连接信息、初始化model表信息

Types

type PostgresConfig

type PostgresConfig struct {
	UserName     string
	Password     string
	Host         string
	Port         int
	DbName       string
	InitDb       bool
	AliasName    string
	SSL          string
	MaxIdleConns int
	MaxOpenConns int
}

PostgresConfig 配置文件对象

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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