Documentation ¶
Index ¶
- Constants
- Variables
- func Alias(fd field.Expr) string
- func CamelToSnake(s string) string
- func DynamicSort(tableName, sortBy, sortOrder string, defaultSort ...field.Expr) field.Expr
- func DynamicSortAgg(tableName, sortBy, sortOrder string, aggFunc func(field.Field) field.Field, ...) field.Expr
- func ILike(column *string) string
- func ILikeHelper(column string) string
- func InitDB() *gorm.DB
- func Page[T int | int8 | int16 | int32 | int64](current, pageSize T) (offset, limit int)
Constants ¶
View Source
const ( OrderAscending = "ascending" OrderAsc = "asc" OrderDescending = "descending" OrderDesc = "desc" )
Variables ¶
View Source
var Unscoped = func(db *gorm.DB) *gorm.DB { return db.Unscoped() }
Functions ¶
func DynamicSort ¶ added in v0.5.0
func DynamicSortAgg ¶ added in v1.0.1
func DynamicSortAgg(tableName, sortBy, sortOrder string, aggFunc func(field.Field) field.Field, defaultSort ...field.Expr) field.Expr
DynamicSortAgg order := DynamicSortAgg(q.TableName(), in.SortBy, in.SortOrder, func(f field.Field) field.Field { return f.Sum() }, q.ProductID.Desc())
func ILikeHelper ¶ added in v0.4.5
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.