database

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// mysql errr number reference: https://mariadb.com/kb/en/mariadb-error-codes/
	ErrNoDuplicateEntry = 1062
	ErrNoKeyNotFound    = 1032

	ErrorKeyIsDuplicated = "DBKeyIsDuplicated" // 数据库key重复
	ErrorUnknown         = "UnknownError"      // 数据库错误
	ErrorRecordNotFound  = "RecordNotFound"    //记录不存在
)

Variables

View Source
var DB *gorm.DB

Functions

func DatabaseFlags

func DatabaseFlags(dbConf *config.DatabaseConfig) []cli.Flag

func GetErrorCode

func GetErrorCode(err error) string

Types

type GormErr

type GormErr struct {
	Number  int    `json:"Number"`
	Message string `json:"Message"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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