filter

package
v0.0.0-...-d5dcd45 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package filter provides filters for squirrel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

Filter is a filter for squirrel.SelectBuilder.

func New

func New(column string, ftype Type, value any) Filter

New creates a new filter.

func (Filter) SetOperator

func (f Filter) SetOperator(operator Operator) Filter

SetOperator sets operator for linking filters.

func (Filter) UseSelectBuilder

func (f Filter) UseSelectBuilder(sb sq.SelectBuilder) sq.SelectBuilder

UseSelectBuilder adds filters to squirrel.SelectBuilder.

func (Filter) WithFilters

func (f Filter) WithFilters(filters ...Filter) Filter

WithFilters adds filters.

type Operator

type Operator uint8

Operator is an operator for linking filters.

const (
	// OperatorAnd is an operator for AND linking filters.
	OperatorAnd Operator = iota + 1
	// OperatorOr is an operator for OR linking filters.
	OperatorOr
)

type Type

type Type uint8

Type is a type of filter.

const (
	// TypeEQ value is equal.
	TypeEQ Type = iota + 1

	// TypeNotEQ value is not equal.
	TypeNotEQ

	// TypeGTE greater than value.
	TypeGTE

	// TypeGT value greater.
	TypeGT

	// TypeLT value less.
	TypeLT

	// TypeLTE value less or equals.
	TypeLTE

	// TypeLike value can contain.
	TypeLike

	// TypeNotLike value cannot contain.
	TypeNotLike

	// TypeILike value can contain (case insensitive).
	TypeILike

	// TypeNotILike value cannot contain (case insensitive).
	TypeNotILike
)

Jump to

Keyboard shortcuts

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