Documentation ¶
Index ¶
- func Count[T any](db *gorm.DB, condition interface{}, args ...interface{}) (int64, error)
- func CountEntity[T any](db *gorm.DB, entity T) (int64, error)
- func CountScope[T any](db *gorm.DB, scope func(db *gorm.DB) *gorm.DB) (int64, error)
- func List[T any](db *gorm.DB, condition interface{}, args ...interface{}) ([]T, error)
- func ListEntity[T any](db *gorm.DB, entity T) ([]T, error)
- func ListEntitySort[T any](db *gorm.DB, sort string, entity T) ([]T, error)
- func ListEntitySortLimitFieldTo[T any, E any](db *gorm.DB, field []string, sort string, limit int, entity T) ([]E, error)
- func ListEntitySortLimitTo[T any, E any](db *gorm.DB, sort string, limit int, entity T) ([]E, error)
- func ListEntitySortTo[T any, E any](db *gorm.DB, sort string, entity T) ([]E, error)
- func ListScope[T any](db *gorm.DB, scope func(db *gorm.DB) *gorm.DB) ([]T, error)
- func ListScopeTo[T any, E any](db *gorm.DB, scope func(db *gorm.DB) *gorm.DB) ([]E, error)
- func ListSort[T any](db *gorm.DB, sort string, condition interface{}, args ...interface{}) ([]T, error)
- func ListSortLimitFieldTo[T any, E any](db *gorm.DB, field []string, sort string, limit int, condition interface{}, ...) ([]E, error)
- func ListSortLimitTo[T any, E any](db *gorm.DB, sort string, limit int, condition interface{}, ...) ([]E, error)
- func ListSortTo[T any, E any](db *gorm.DB, sort string, condition interface{}, args ...interface{}) ([]E, error)
- func One[T any](db *gorm.DB, condition interface{}, args ...interface{}) (T, error)
- func OneEntity[T any](db *gorm.DB, entity T) (T, error)
- func OneEntityFieldTo[T any, E any](db *gorm.DB, field []string, entity T) (E, error)
- func OneEntityTo[T any, E any](db *gorm.DB, entity T) (E, error)
- func OneEntityTry[T any](db *gorm.DB, entity T) (T, error)
- func OneFieldTo[T any, E any](db *gorm.DB, field []string, condition interface{}, args ...interface{}) (E, error)
- func OneKey[T any](db *gorm.DB, key any) (T, error)
- func OneKeyFieldTo[T any, E any](db *gorm.DB, field []string, key any) (E, error)
- func OneKeyTo[T any, E any](db *gorm.DB, key any) (E, error)
- func OneKeyTry[T any](db *gorm.DB, key any) (T, error)
- func OneScope[T any](db *gorm.DB, scope func(db *gorm.DB) *gorm.DB) (T, error)
- func OneScopeTo[T any, E any](db *gorm.DB, scope func(db *gorm.DB) *gorm.DB) (E, error)
- func OneScopeTry[T any](db *gorm.DB, scope func(db *gorm.DB) *gorm.DB) (T, error)
- func OneTo[T any, E any](db *gorm.DB, condition interface{}, args ...interface{}) (E, error)
- func OneTry[T any](db *gorm.DB, condition interface{}, args ...interface{}) (T, error)
- func Page[T any](db *gorm.DB, size, page int, condition interface{}, args ...interface{}) (int64, []T, error)
- func PageEntity[T any](db *gorm.DB, size, page int, entity T) (int64, []T, error)
- func PageEntitySort[T any](db *gorm.DB, sort string, size, page int, entity T) (int64, []T, error)
- func PageEntitySortFieldTo[T any, E any](db *gorm.DB, field []string, sort string, size, page int, entity T) (int64, []E, error)
- func PageEntitySortTo[T any, E any](db *gorm.DB, sort string, size, page int, entity T) (int64, []E, error)
- func PageScope[T any](db *gorm.DB, size, page int, scope func(db *gorm.DB) *gorm.DB) (int64, []T, error)
- func PageScopeFieldTo[T any, E any](db *gorm.DB, field []string, size, page int, scope func(db *gorm.DB) *gorm.DB) (int64, []E, error)
- func PageSort[T any](db *gorm.DB, sort string, size, page int, condition interface{}, ...) (int64, []T, error)
- func PageSortFieldTo[T any, E any](db *gorm.DB, field []string, sort string, size, page int, ...) (int64, []E, error)
- func PageSortTo[T any, E any](db *gorm.DB, sort string, size, page int, condition interface{}, ...) (int64, []E, error)
- func Paginate(size int, page int) func(db *gorm.DB) *gorm.DB
- func Remove[T any](db *gorm.DB, condition interface{}, args ...interface{}) (bool, error)
- func RemoveEntity[T any](db *gorm.DB, entity T) (bool, error)
- func RemoveKey[T any](db *gorm.DB, key any) (bool, error)
- func RemoveScope[T any](db *gorm.DB, scope func(db *gorm.DB) *gorm.DB) (bool, error)
- func Update[T any](db *gorm.DB, column string, value interface{}, condition interface{}, ...) (int64, error)
- func UpdateEntity[T any](db *gorm.DB, column string, value interface{}, entity T) (int64, error)
- func UpdateScope[T any](db *gorm.DB, column string, value interface{}, ...) (int64, error)
- func Updates[T any](db *gorm.DB, value map[string]interface{}, condition interface{}, ...) (int64, error)
- func UpdatesEntity[T any](db *gorm.DB, value map[string]interface{}, entity T) (int64, error)
- func UpdatesScope[T any](db *gorm.DB, value map[string]interface{}, scope func(db *gorm.DB) *gorm.DB) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountScope ¶
func ListEntitySortLimitTo ¶
func ListEntitySortTo ¶
func ListScopeTo ¶
func ListSortLimitFieldTo ¶
func ListSortLimitTo ¶
func ListSortTo ¶
func OneEntityFieldTo ¶
func OneFieldTo ¶
func OneKeyFieldTo ¶
func OneScopeTo ¶
func OneScopeTry ¶
* 自定义模式查询one - 满足多表组合等复杂查询
func Page ¶
func Page[T any](db *gorm.DB, size, page int, condition interface{}, args ...interface{}) (int64, []T, error)
* 指定参数进行分页查询 - 单表
func PageEntity ¶
* 指定对象进行分页查询 - 单表
func PageEntitySort ¶
func PageEntitySortFieldTo ¶
func PageEntitySortTo ¶
func PageScope ¶
func PageScope[T any](db *gorm.DB, size, page int, scope func(db *gorm.DB) *gorm.DB) (int64, []T, error)
* 自定义scope进行分页查询 - 用于组合连表等复杂查询
func PageScopeFieldTo ¶
func PageSortFieldTo ¶
func PageSortTo ¶
func RemoveScope ¶
func Update ¶
func Update[T any](db *gorm.DB, column string, value interface{}, condition interface{}, args ...interface{}) (int64, error)
更新单列
func UpdateEntity ¶
func UpdateScope ¶
func Updates ¶
func Updates[T any](db *gorm.DB, value map[string]interface{}, condition interface{}, args ...interface{}) (int64, error)
更新多列
func UpdatesEntity ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.