query

package
v0.0.0-...-cb527ea Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition struct {
	ColumnName string
	Column     int
	Type       ConditionType
	Parameter  any
}

func BAnd

func BAnd[T Integer](column_name string, mask T) Condition

Matches if the result of column value & right-hand mask is non-zero

func Eq

func Eq(column_name string, parameter any) (condition Condition)

Matches if the column is equal to the right-hand parameter

func Gt

func Gt[T Numeric](column_name string, rh T) Condition

Matches if column value is greater than than right-hand parameter rh

func Gte

func Gte[T Numeric](column_name string, rh T) Condition

Matches if column value is greater than or equal to right-hand parameter rh

func Lt

func Lt[T Numeric](column_name string, rh T) Condition

Matches if column value is less than right-hand parameter rh

func Lte

func Lte[T Numeric](column_name string, rh T) Condition

Matches if column value is less than or equal to right-hand parameter rh

func Not

func Not(condition Condition) Condition

Inverts the matching behavior of the supplied condition

func Or

func Or(conditions ...Condition) Condition

Matches if multiple conditions are true

func Regex

func Regex(column_name string, expr string) Condition

Matches column values that match a POSIX-compatible regular expression

type ConditionType

type ConditionType uint8
const (
	Condition_Equals ConditionType = iota
	Condition_GreaterThan
	Condition_LessThan
	Condition_LessThanOrEqual
	Condition_GreaterThanOrEqual
	Condition_RegularExpression
	Condition_Not
	Condition_Or
	Condition_BitwiseAND
)

type Expression

type Expression struct {
	Conditions         []Condition
	Sort               bool
	OrderByColumnIndex int
	Descending         bool
	Limit              uint64 // zero if no limit
}

type Integer

type Integer interface {
	~int | ~int8 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64
}

Constrains types that are subject to bitwise operations

type Numeric

type Numeric interface {
	~int | ~int8 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~float32 | ~float64 | time.Time
}

Constrains types that can be said to be greater or less than other values of the same type

Jump to

Keyboard shortcuts

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