fields

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filterable

func Filterable(name string) query.Field

Filterable constructs new field definition with only filtering capability. It can be suitable for enums.

func Indexed

func Indexed(name string) query.Field

Indexed constructs new field definition with enabled sorting and filtering capabilities.

func List

func List(f ...query.Field) []query.Field

List is s handy func to create slice of fields.

func New

func New(name string, filter, sort bool, dataType interface{}) query.Field

New constructs new field definition with given settings

func Typed

func Typed(f query.Field, dataType interface{}) query.Field

Typed adds type definition for given field

func Untyped

func Untyped(name string, filter, sort bool) query.Field

Untyped constructs new field definition with given settings but without type

func VerifyCondition

func VerifyCondition(c query.Condition) (err error)

VerifyCondition checks that condition has only fields on the left side of rules inside it and those fields are allowed to be used as filter (i.e. in WHERE clause).

This method will fail if string names are used instead of fields - to fix it apply boxing first.

func VerifyFilter

func VerifyFilter(c query.Filter) (err error)

VerifyFilter checks that condition has only fields on the left side of rules inside it and those fields are allowed to be used as filter (i.e. in WHERE clause).

Also, it checks that sorting is using fields allowing sorting operation too.

This method will fail if string names are used instead of fields - to fix it apply boxing first.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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