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