query

package module
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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aliased

type Aliased interface {
	Alias() string
}

Aliased is interface for entries (columns, schemas) that can be aliased.

type AliasedName

type AliasedName interface {
	Aliased
	Named
}

AliasedName defines pair of alias and original name

type Condition

type Condition interface {
	Type() Logic
	Rules() []Rule
	Conditions() []Condition
}

Condition represents complex condition, that may include rules and other conditions

type Field

type Field interface {
	Named
	DataType() interface{}
	Sortable() bool
	Filterable() bool
}

Field defined physical or logical column

type Filter

type Filter interface {
	Condition

	Sorting() []Sorting
	Limit() int
	Offset() int
}

Filter extends condition with limits and sorting

type Logic

type Logic byte

Logic describes inner relations inside conditions Can be AND or OR

const (
	None Logic = 0
	And  Logic = 1
	Or   Logic = 2
)

List of defined condition relations

func (Logic) String

func (l Logic) String() string

String returns string representation of logic operator

type Named

type Named interface {
	Name() string
}

Named is interface for named entries (columns, schemas)

type Query

type Query interface {
	Filter

	Schema() Named
	Columns() []Named
}

Query describes common select query

type Rule

type Rule interface {
	Left() interface{}
	Right() interface{}
	Type() match.Type
}

Rule contains rule definition. It consist of left and right parts and matching operator.

type SortOrder

type SortOrder byte

SortOrder specifies collection ordering

const (
	UnknownSort SortOrder = 0
	Asc         SortOrder = 1
	Desc        SortOrder = 2
)

List of defined order types

type Sorting

type Sorting interface {
	Named

	Type() SortOrder
}

Sorting contains sort order definition

Directories

Path Synopsis
box
json
sql

Jump to

Keyboard shortcuts

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