Documentation
¶
Index ¶
- Constants
- func IsGroupOperator(o Operator) bool
- type Column
- func AverageAs(expression Expression, alias string) Column
- func Columns(names ...string) []Column
- func CountAs(expression Expression, alias string) Column
- func MaxAs(expression Expression, alias string) Column
- func MinAs(expression Expression, alias string) Column
- func SumAs(expression Expression, alias string) Column
- type Comparison
- type Condition
- type Expression
- type Operator
Constants ¶
View Source
const ( SUM = "SUM" COUNT = "COUNT" MIN = "MIN" MAX = "MAX" AVERAGE = "AVG" )
View Source
const ( // Equal is a Comparison operator Equal Operator = "==" // And is a Comparison operator And = "AND" // Or is a Comparison operator Or = "OR" // In is a Comparison operator In = "In" )
Variables ¶
This section is empty.
Functions ¶
func IsGroupOperator ¶
IsGroupOperator says if an operator is a group operator
Types ¶
type Column ¶
type Column struct { Alias string `json:"alias"` Expression Expression `json:"expression"` }
Column reference a column in a SELECT statement
func AverageAs ¶
func AverageAs(expression Expression, alias string) Column
AverageAs returns average value for a given expression
func CountAs ¶
func CountAs(expression Expression, alias string) Column
CountAs aggregate function (see SQL COUNT())
func MaxAs ¶
func MaxAs(expression Expression, alias string) Column
MaxAs returns maximum value for a given expression
func MinAs ¶
func MinAs(expression Expression, alias string) Column
MinAs returns minimum value for a given expression
func SumAs ¶
func SumAs(expression Expression, alias string) Column
SumAs aggregate function (see SQL SUM())
type Comparison ¶
type Comparison struct { Operator Operator `json:"operator"` Expressions []Expression `json:"expressions"` }
Comparison defines a contact for a comparison
func NewComparison ¶
func NewComparison(o Operator, expressions ...Expression) Comparison
NewComparison creates new Comparison
func (Comparison) String ¶
func (v Comparison) String() string
String returns string representation of a comparison
type Expression ¶
Expression represent either a field, constant or a formula
func Field ¶
func Field(name string) Expression
Field creates an expression that represents a field value
func ID ¶
func ID(name string, value interface{}) Expression
ID creates an expression that compares an ID with a constant
Click to show internal directories.
Click to hide internal directories.