helper

package
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Transaction

func Transaction(tf transactionFunc, attempts uint)

Types

type Helper

type Helper struct {
	model.BaseModel
}

func (*Helper) Count

func (h *Helper) Count(in model.Modeller, filterArr []model.Filter, withTrashed bool) (count int64, err error)

*

pangxianfei by ad count int64

func (*Helper) Create

func (h *Helper) Create(outPtr interface{}) error

out must be a struct pointer

func (*Helper) Delete

func (h *Helper) Delete(in interface{}, force bool) error

func (*Helper) Exist

func (h *Helper) Exist(in model.Modeller, withTrashed bool) (exist bool)

func (*Helper) First

func (h *Helper) First(outPtr interface{}, withTrashed bool) error

outPtr must be a struct pointer outPtr必须是结构指针

func (*Helper) FirstForUpdate

func (h *Helper) FirstForUpdate(outPtr interface{}, withTrashed bool) error

func (*Helper) Q

func (h *Helper) Q(filterArr []model.Filter, sortArr []model.Sort, limit int, withTrashed bool) *gorm.DB

func (*Helper) Restore

func (h *Helper) Restore(in interface{}) error

func (*Helper) Save

func (h *Helper) Save(outPtr interface{}, modify interface{}, nullDataPtr ...interface{}) error

outPtr must be a struct pointer, modify and nullDataPtr must be a same type

func (*Helper) SaveByID

func (h *Helper) SaveByID(id interface{}, outPtr interface{}, modify interface{}) error

func (*Helper) SetTX

func (h *Helper) SetTX(db *gorm.DB)

Jump to

Keyboard shortcuts

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