clause

package
v2.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Limit added in v2.0.4

func Limit(limit, offset int) func(tx *gorm.DB) *gorm.DB

func OnConflict

func OnConflict(onConflict []interface{}, doUpdates []interface{}) clause.OnConflict

func OrderBy

func OrderBy(quoteTo func(string) string, orderBy map[string]string, tableName string) func(tx *gorm.DB) *gorm.DB

func Returning

func Returning(columns ...string) clause.Returning

func SearchFilter

func SearchFilter(search map[string]interface{}, searchable FieldSearchable) func(tx *gorm.DB) *gorm.DB

func Where

func Where(quoteTo func(string) string, query string, args ...interface{}) func(tx *gorm.DB) *gorm.DB

func WhereFilter

func WhereFilter(search map[string]interface{}, searchable FieldSearchable) func(tx *gorm.DB) *gorm.DB

Types

type Condition

type Condition string
const (
	EqualCondition    Condition = "="
	NotEqualCondition Condition = "<>"
	LikeCondition     Condition = "LIKE"
	InCondition       Condition = "IN"
	BetweenCondition  Condition = "BETWEEN"
	QueryCondition    Condition = "QUERY"
)

type FieldSearchable

type FieldSearchable map[string]*Search
type Search struct {
	Condition Condition
	Column    string
	Context   SearchContext
	// contains filtered or unexported fields
}

type SearchContext

type SearchContext int
const (
	AllCtx SearchContext = iota
	WhereCtx
	SearchCtx
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL