filters

package
v0.0.0-...-79003c6 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ClassInternal defines internal filters error.
	ClassInternal errors.Class
)

Functions

func RegisterSQLizer

func RegisterSQLizer(o *query.Operator, sqlizer SQLizer, raw ...string)

RegisterSQLizer registers new SQLizer function for the provided operator. Optionally can set the raw SQL value.

func SQLOperator

func SQLOperator(o *query.Operator) (string, error)

SQLOperator gets the operator sql name.

func SplitFilterStrings

func SplitFilterStrings(s string) []string

SplitFilterStrings splits the filter string value into array of strings.

Types

type SQLQueries

type SQLQueries []*SQLQuery

SQLQueries is the wrapper arount the SQL queries value.

func BasicSQLizer

func BasicSQLizer(s *query.Scope, quotedWriter internal.QuotedWordWriteFunc, field *mapping.StructField, fv *query.OperatorValues) (SQLQueries, error)

BasicSQLizer gets the SQLQueries from the provided filter.

func InSQLizer

func InSQLizer(s *query.Scope, quotedWriter internal.QuotedWordWriteFunc, field *mapping.StructField, fv *query.OperatorValues) (SQLQueries, error)

InSQLizer creates the SQLQueries for the 'IN' and 'NOT IN' filter Operators.

func NullSQLizer

func NullSQLizer(s *query.Scope, quotedWriter internal.QuotedWordWriteFunc, field *mapping.StructField, fv *query.OperatorValues) (SQLQueries, error)

NullSQLizer is the SQLizer function that returns NULL'ed queries.

func ParseFilters

func ParseFilters(s *query.Scope, writer internal.QuotedWordWriteFunc) (SQLQueries, error)

ParseFilters parses the filters into SQLQueries for the provided scope.

func StringOperatorsSQLizer

func StringOperatorsSQLizer(s *query.Scope, quotedWriter internal.QuotedWordWriteFunc, field *mapping.StructField, fv *query.OperatorValues) (SQLQueries, error)

StringOperatorsSQLizer creates the SQLQueries for the provided filter values.

type SQLQuery

type SQLQuery struct {
	Query  string
	Values []interface{}
}

SQLQuery defines the SQL query Models pair

type SQLizer

SQLizer is the function that sqlizes provided OperatorValuePair.

Jump to

Keyboard shortcuts

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