expressions

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Avg

type Avg struct {
	Expr Expression
}

Avg is a avg aggregate function.

func NewAvg

func NewAvg(column *Column) *Avg

NewAvg returns a new Avg aggregate functions expression.

func (*Avg) WriteTo

func (a *Avg) WriteTo(sw io.StringWriter) error

type Column

type Column struct {
	From string // table name
	Name string // column name
}

Column is a column in a table

func (Column) WriteTo

func (s Column) WriteTo(sw io.StringWriter) error

Write writes the column to the given writer

type Count

type Count struct {
	Expr Expression
}

Count is a count aggregate function.

func NewCount

func NewCount(column *Column) *Count

NewCount returns a new Count aggregate functions expression.

func (*Count) WriteTo

func (c *Count) WriteTo(sw io.StringWriter) error

WriteTo implements Expression.

type Expression

type Expression interface {
	WriteTo(io.StringWriter) error
}

Expression is a generic SQL expression.

type List added in v0.0.2

type List []Expression

List is a list of expressions separated by a comma.

func (List) WriteTo added in v0.0.2

func (e List) WriteTo(writer io.StringWriter) error

type Max

type Max struct {
	Expr Expression
}

Max is a max aggregate function.

func NewMax

func NewMax(column *Column) *Max

NewMax returns a new Max aggregate functions expression.

func (*Max) WriteTo

func (m *Max) WriteTo(sw io.StringWriter) error

type Min

type Min struct {
	Expr Expression
}

Min is a min aggregate function.

func NewMin

func NewMin(column *Column) *Min

NewMin returns a new Min aggregate functions expression.

func (*Min) WriteTo

func (m *Min) WriteTo(sw io.StringWriter) error

type Sum

type Sum struct {
	Expr Expression
}

Sum is a sum aggregate function.

func NewSum

func NewSum(column *Column) *Sum

NewSum returns a new Sum aggregate functions expression.

func (*Sum) WriteTo

func (s *Sum) WriteTo(sw io.StringWriter) error

Jump to

Keyboard shortcuts

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