Documentation ¶
Index ¶
- Variables
- func CtxDB(ctx context.Context) func(db *gorm.DB) *gorm.DB
- func Paginate(pg paginator.Param) func(db *gorm.DB) *gorm.DB
- func QueryPages(db *gorm.DB, pg paginator.Param, out interface{}) (paginator.Info, error)
- func QueryPagesAssociation(db *gorm.DB, pg paginator.Param, out interface{}, column string) (paginator.Info, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrZeroOrEmptyValue = errors.New("value must not be zero or empty") ErrObjectAlreadyExist = errors.New("object already exist") ErrHasAssociation = errors.New("object has associate other object") ErrOperateNotPermitted = errors.New("operate not permitted") ErrOutOfRange = errors.New("out of range") ErrInvalidParameter = errors.New("invalid parameter") ErrConflict = errors.New("data field conflict") )
基本错误
Functions ¶
func QueryPages ¶
QueryPages 分页查询 db需提供model和条件, list需提供切片地址 如 &[]yourStruct{} pg 如果均为默认参数,将不进行分页查询,将返回所有数据
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.