db_gorm

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package db_gorm

@author: xwc1125

Package db_gorm

@author: xwc1125

Package db_gorm

@author: xwc1125

Package db_gorm

@author: xwc1125

Package db_gorm

@author: xwc1125

Package db_gorm

@author: xwc1125

Index

Constants

This section is empty.

Variables

View Source
var GormDBOpens = map[string]func(string) gorm.Dialector{
	"mysql":    mysql.Open,
	"postgres": postgres.Open,
}
View Source
var SysTimeLocation, _ = time.LoadLocation("Asia/Shanghai")

中国时区

Functions

func MakeCondition

func MakeCondition(dbDrive string, q interface{}) func(db *gorm.DB) *gorm.DB

func MakePaginate

func MakePaginate(page types.PageQuery) func(db *gorm.DB) *gorm.DB

func MasterEngine

func MasterEngine(config database.MysqlConfig) *gorm.DB

MasterEngine 主库,单例

func New

func New(config logger.Config) logger.Interface

func NewEngine

func NewEngine(config database.MysqlConfig) *gorm.DB

func OrderDest

func OrderDest(sort string, bl bool) func(db *gorm.DB) *gorm.DB

func Paginate

func Paginate(pageSize, pageIndex int64) func(db *gorm.DB) *gorm.DB

func QueryDBErr

func QueryDBErr(tx *gorm.DB) types.JsonError

func SelectPage

func SelectPage(db *gorm.DB, req types.PageQuery, wrapper map[string]interface{}, model interface{}) (result *response.PageInfo, err error)

func UpdateDBErr

func UpdateDBErr(tx *gorm.DB) types.JsonError

Types

This section is empty.

Jump to

Keyboard shortcuts

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