filters

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Incrementor added in v0.4.0

func Incrementor(s *query.Scope) int

Incrementor is the function that returns next query increment value. Used to obtain the queries values with the incremented arguments.

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.

func StringIncrementor added in v0.4.0

func StringIncrementor(s *query.Scope) string

StringIncrementor is the function that returns next query increment value in a string form. Used to obtain the queries values with the incremented arguments.

Types

type SQLQueries

type SQLQueries []*SQLQuery

SQLQueries is the wrapper arount the SQL queries value.

func BasicSQLizer

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

BasicSQLizer gets the SQLQueries from the provided filter.

func InSQLizer

func InSQLizer(s *query.Scope, 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, 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) (SQLQueries, error)

ParseFilters parses the filters into SQLQueries for the provided scope.

func StringOperatorsSQLizer

func StringOperatorsSQLizer(s *query.Scope, 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 Values 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