expressions

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 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) Write added in v0.0.3

func (a *Avg) Write(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) Write added in v0.0.3

func (s Column) Write(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) Write added in v0.0.3

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

WriteTo implements Expression.

type Expression

type Expression interface {
	Write(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) Write added in v0.0.3

func (e List) Write(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) Write added in v0.0.3

func (m *Max) Write(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) Write added in v0.0.3

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

type String added in v0.0.3

type String string

func NewString added in v0.0.3

func NewString(s string) String

func (String) Write added in v0.0.3

func (e String) Write(writer 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) Write added in v0.0.3

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

Jump to

Keyboard shortcuts

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