Documentation ¶
Index ¶
- Variables
- func Check(ctx context.Context, db *gorm.DB) (bool, error)
- func ExecTrans(ctx context.Context, db *gorm.DB, fn TransFunc) error
- func ExecTransWithLock(ctx context.Context, db *gorm.DB, fn TransFunc) error
- func FindOne(ctx context.Context, db *gorm.DB, out interface{}) (bool, error)
- func FindPage(ctx context.Context, db *gorm.DB, pp schema.PaginationParam, out interface{}) (int64, error)
- func GetDB(ctx context.Context, defDB *gorm.DB) *gorm.DB
- func GetDBWithModel(ctx context.Context, defDB *gorm.DB, m interface{}) *gorm.DB
- func ParseOrder(items []*schema.OrderField, handle ...OrderFieldFunc) string
- func WrapPageQuery(ctx context.Context, db *gorm.DB, pp schema.PaginationParam, out interface{}) (*schema.PaginationResult, error)
- type Model
- type OrderFieldFunc
- type Trans
- type TransFunc
Constants ¶
This section is empty.
Variables ¶
TransSet 注入Trans
Functions ¶
func ExecTransWithLock ¶
ExecTransWithLock 执行事务(加锁)
func FindPage ¶
func FindPage(ctx context.Context, db *gorm.DB, pp schema.PaginationParam, out interface{}) (int64, error)
FindPage 查询分页数据
func GetDBWithModel ¶
GetDBWithModel Get gorm.DB.Model from context
func ParseOrder ¶
func ParseOrder(items []*schema.OrderField, handle ...OrderFieldFunc) string
ParseOrder 解析排序字段
func WrapPageQuery ¶
func WrapPageQuery(ctx context.Context, db *gorm.DB, pp schema.PaginationParam, out interface{}) (*schema.PaginationResult, error)
WrapPageQuery 包装带有分页的查询
Types ¶
Click to show internal directories.
Click to hide internal directories.