clause

package
v2.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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