database

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBWithContext

func DBWithContext(ctx context.Context) *gorm.DB

func IsErrUniqueViolation

func IsErrUniqueViolation(err error) bool

func MustInit

func MustInit(dbCfg Config)

MustInit must be called before this package is used. It initializes the database connection pool.

Types

type Config

type Config struct {
	URI           string `mapstructure:"uri"`
	Database      string
	DriverName    string `mapstructure:"drivername"`
	Host          string
	User          string
	Password      string
	Port          string
	SSLMode       string `mapstructure:"sslmode"`
	EnableLogging bool   `mapstructure:"enableLogging"`
}

Jump to

Keyboard shortcuts

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