Aggregate functions

This commit is contained in:
zer0sub 2019-06-03 18:28:16 +02:00
parent dca028295d
commit d69c67569a
5 changed files with 159 additions and 59 deletions

View file

@ -177,19 +177,37 @@ func Date(year, month, day int) DateExpression {
}
//--------------------------------------------------//
type nullExpression struct {
type nullLiteral struct {
expressionInterfaceImpl
}
func newNullExpression() expression {
nullExpression := &nullExpression{}
func newNullLiteral() expression {
nullExpression := &nullLiteral{}
nullExpression.expressionInterfaceImpl.parent = nullExpression
return nullExpression
}
func (n *nullExpression) serialize(statement statementType, out *queryData, options ...serializeOption) error {
func (n *nullLiteral) serialize(statement statementType, out *queryData, options ...serializeOption) error {
out.writeString("NULL")
return nil
}
//--------------------------------------------------//
type starLiteral struct {
expressionInterfaceImpl
}
func newStarLiteral() expression {
starExpression := &starLiteral{}
starExpression.expressionInterfaceImpl.parent = starExpression
return starExpression
}
func (n *starLiteral) serialize(statement statementType, out *queryData, options ...serializeOption) error {
out.writeString("*")
return nil
}