query

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FilterNot                   = "not"         // Not equal to
	FilterIn                    = "in"          // Check if value is in list
	FilterNotIn                 = "not_in"      // Not in list
	FilterGTE                   = "gte"         // Greater than or equal to the passed value
	FilterGT                    = "gt"          // Greater than passed value
	FilterLTE                   = "lte"         // Less than or equal to the passed value
	FilterLT                    = "lt"          // Less than passed value
	FilterRange                 = "range"       // Whether it is between the two given values
	FilterIsNull                = "isnull"      // Is it empty
	FilterNotIsNull             = "not_isnull"  // Whether it is not empty
	FilterContains              = "contains"    // Whether to contain the specified substring
	FilterInsensitiveContains   = "icontains"   // Case-insensitive, whether to contain the specified substring
	FilterStartsWith            = "startswith"  // Start with value
	FilterInsensitiveStartsWith = "istartswith" // Case-insensitive, starts with value
	FilterEndsWith              = "endswith"    // End with value
	FilterInsensitiveEndsWith   = "iendswith"   // Case-insensitive, ends with value
	FilterExact                 = "exact"       // Exact match
	FilterInsensitiveExact      = "iexact"      // Case-insensitive, exact match
	FilterRegex                 = "regex"       // Regular expression
	FilterInsensitiveRegex      = "iregex"      // Case-insensitive, regular expression
	FilterSearch                = "search"      // Research all
)

Variables

This section is empty.

Functions

func BuildFieldSelect

func BuildFieldSelect(s *sql.Selector, fields []string)

func BuildFieldSelector

func BuildFieldSelector(fields []string) (error, func(s *sql.Selector))

func BuildFilterSelector

func BuildFilterSelector(andFilterJsonString, orFilterJsonString string) (error, []func(s *sql.Selector))

func BuildOrderSelect

func BuildOrderSelect(s *sql.Selector, field string, desc bool)

BuildOrderSelect .

func BuildOrderSelector

func BuildOrderSelector(orderBys []string, defaultOrderField string) (error, func(s *sql.Selector))

BuildOrderSelector .

func BuildPaginationSelect

func BuildPaginationSelect(s *sql.Selector, page, pageSize int32)

BuildPaginationSelect .

func BuildPaginationSelector

func BuildPaginationSelector(page, pageSize int32, noPaging bool) func(*sql.Selector)

BuildPaginationSelector .

func BuildQuerySelector

func BuildQuerySelector(
	andFilterJsonString, orFilterJsonString string,
	page, pageSize int32, noPaging bool,
	orderBys []string, defaultOrderField string,
	selectFields []string,
) (err error, whereSelectors []func(s *sql.Selector), querySelectors []func(s *sql.Selector))

BuildQuerySelector builds a paging filter query

func QueryCommandToOrderConditions

func QueryCommandToOrderConditions(orderBys []string) (error, func(s *sql.Selector))

QueryCommandToOrderConditions query commands converted into sorting conditions

func QueryCommandToWhereConditions

func QueryCommandToWhereConditions(strJson string, isOr bool) (error, func(s *sql.Selector))

QueryCommandToWhereConditions converts query commands into selection conditions

Types

type DatePart

type DatePart int
const (
	DatePartDate        DatePart = iota // Date
	DatePartYear                        // Year
	DatePartISOYear                     // ISO 8601 - Number of weeks in year
	DatePartQuarter                     // Quarter
	DatePartMonth                       // Month
	DatePartWeek                        // ISO 8601 - week number, number of week in year
	DatePartWeekDay                     // Day of the week
	DatePartISOWeekDay                  // Day of the week (ISO)
	DatePartDay                         // Day
	DatePartTime                        // Hours: Minutes: Seconds
	DatePartHour                        // Hour
	DatePartMinute                      // Minute
	DatePartSecond                      // Second
	DatePartMicrosecond                 // Microseconds
)

type FilterOp

type FilterOp int

Jump to

Keyboard shortcuts

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