entgo

package
v0.0.0-...-f0a7105 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

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)

func BuildOrderSelector

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

func BuildPaginationSelect

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

func BuildPaginationSelector

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

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 Build a paginated 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 Convert query commands to selection conditions

Types

type DatePart

type DatePart int
const (
	FilterNot                   DatePart = iota // Not equal to
	FilterIn                                    // Check if value is in list
	FilterNotIn                                 // Not in list
	FilterGTE                                   // Greater than or equal to the passed value
	FilterGT                                    // Greater than passed value
	FilterLTE                                   // Less than or equal to the passed value
	FilterLT                                    // Less than passed value
	FilterRange                                 // Whether it is between the two given values
	FilterIsNull                                // Is it empty
	FilterNotIsNull                             // Whether it is not empty
	FilterContains                              // Whether to contain the specified substring
	FilterInsensitiveContains                   // Case-insensitive, whether to contain the specified substring
	FilterStartsWith                            // Start with value
	FilterInsensitiveStartsWith                 // Case-insensitive, starts with value
	FilterEndsWith                              // End with value
	FilterInsensitiveEndsWith                   // Case-insensitive, ends with value
	FilterExact                                 // Exact match
	FilterInsensitiveExact                      // Case-insensitive, exact match
	FilterRegex                                 // Regular expression
	FilterInsensitiveRegex                      // Case-insensitive, regular expression
	FilterSearch                                // Research all
)
const (
	DatePartDate        DatePart = iota // Date
	DatePartYear                        // Year
	DatePartISOYear                     // ISO 8601 Number of weeks in year
	DatePartQuarter                     // Quarter
	DatePartMonth                       // Month
	DatePartWeek                        // ISO 8601 Week number - The number of weeks in the year
	DatePartWeekDay                     // Day of the week
	DatePartISOWeekDay                  // Day of the week
	DatePartDay                         // Day
	DatePartTime                        // Hours: Minutes: Seconds
	DatePartHour                        // Hour
	DatePartMinute                      // Minutes
	DatePartSecond                      // Seconds
	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