ql

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute added in v0.0.2

func Execute[T any](src *[]T, dst *[]T, query string, facets func(*[]T),
	opts ...executeOption) (err error)

Types

type AndCondition

type AndCondition struct {
	Or []Condition `@@ ( "OR" @@ )*`
}

type Compare

type Compare struct {
	Operator string `@Operator`
	Right    *Value `@@`
}

type Condition

type Condition struct {
	Not     *Condition        `"NOT" @@`
	Operand *ConditionOperand `| @@`
}

type ConditionOperand

type ConditionOperand struct {
	Left  *Value   `@@`
	Right *Compare `@@?`
}

type DefaultLimit added in v0.0.2

type DefaultLimit int

type DefaultOrder added in v0.0.2

type DefaultOrder []OrderBy

type Expression

type Expression struct {
	And []AndCondition `@@ ( "AND" @@ )*`
}

type OrderBy

type OrderBy struct {
	Identifier string `@Ident`
	Direction  string `@( "ASC" | "DESC" )?`
}

func Asc

func Asc(f string) OrderBy

func Desc

func Desc(f string) OrderBy

type Query

type Query struct {
	Expression *Expression `@@`
	// And     []*AndCondition `@@ ( "AND" @@ )*`
	OrderBy []OrderBy `("ORDER" "BY" @@ (Comma @@)*)?`
	Limit   int       `("LIMIT" @Int)?`
}

type Value

type Value struct {
	Number     *float64    `@(Float|Int)`
	Duration   *string     `| @Duration`
	String     *string     `| @String`
	Identifier *string     `| @Ident`
	Inner      *Expression `| "(" @@ ")"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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