Documentation
¶
Index ¶
- Constants
- Variables
- func Limit(limit, offset int) func(tx *gorm.DB) *gorm.DB
- func OnConflict(onConflict []interface{}, doUpdates []interface{}) clause.OnConflict
- func OrderBy(quoteTo func(string) string, orderBy map[string]string, tableName string) func(tx *gorm.DB) *gorm.DB
- func OrderByFilter(quoteTo func(string) string, orderBy map[string]string, ...) (string, []string, error)
- func Returning(columns ...string) clause.Returning
- func Where(quoteTo func(string) string, query string, args ...interface{}) func(tx *gorm.DB) *gorm.DB
- func WhereFilter(quoteTo func(string) string, expression *ExpressionWhere, ...) (string, []interface{}, []string, error)
- type ExpressionWhere
- type FieldOrderBy
- type FieldSearchable
- type Order
- type Search
- type Type
Constants ¶
View Source
const ( OrderByAsc string = "ASC" OrderByDesc string = "DESC" )
Variables ¶
View Source
var ( ErrFilterUnknownOperator = apperr.New("filter_unknown_operator", apperr.WithTextTranslate(i18n.ErrFilterUnknownOperator), apperr.WithCode(code.InvalidArgument)) ErrFilterInvalidOperator = apperr.New("filter_invalid_operator", apperr.WithTextTranslate(i18n.ErrFilterInvalidOperator), apperr.WithCode(code.InvalidArgument)) ErrFilterUnknownColumn = apperr.New("filter_unknown_column", apperr.WithTextTranslate(i18n.ErrFilterUnknownColumn), apperr.WithCode(code.InvalidArgument)) ErrFilterInvalidValue = apperr.New("filter_invalid_value", apperr.WithTextTranslate(i18n.ErrFilterInvalidValue), apperr.WithCode(code.InvalidArgument)) )
View Source
var (
ErrOrderByUnknownColumn = apperr.New("order_by_unknown_column", apperr.WithTextTranslate(i18n.ErrOrderByUnknownColumn), apperr.WithCode(code.InvalidArgument))
)
Functions ¶
func OnConflict ¶
func OnConflict(onConflict []interface{}, doUpdates []interface{}) clause.OnConflict
func OrderByFilter ¶ added in v2.1.9
func WhereFilter ¶
func WhereFilter(quoteTo func(string) string, expression *ExpressionWhere, fieldSearchable FieldSearchable) (string, []interface{}, []string, error)
Types ¶
type ExpressionWhere ¶ added in v2.1.9
type ExpressionWhere struct { Expressions []ExpressionWhere Column string Operation string Value string }
type FieldOrderBy ¶ added in v2.1.9
type FieldSearchable ¶
Click to show internal directories.
Click to hide internal directories.