Documentation
¶
Index ¶
- 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 pagination.Param, 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 NewDB(c *Config) (*gorm.DB, func(), error)
- func ParseOrder(items []*pagination.OrderField, handle ...OrderFieldFunc) string
- func WrapPageQuery(ctx context.Context, db *gorm.DB, pp pagination.Param, out interface{}) (*pagination.Pagination, error)
- type Config
- type OrderFieldFunc
- type TransFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecTransWithLock ¶
func GetDBWithModel ¶
func ParseOrder ¶
func ParseOrder(items []*pagination.OrderField, handle ...OrderFieldFunc) string
func WrapPageQuery ¶
func WrapPageQuery(ctx context.Context, db *gorm.DB, pp pagination.Param, out interface{}) (*pagination.Pagination, error)
Types ¶
type OrderFieldFunc ¶
Click to show internal directories.
Click to hide internal directories.