Add new comma expression

This commit is contained in:
riverchu 2021-07-14 15:20:27 +08:00
parent d4f3c109d6
commit 8305e6bf42

View File

@ -43,3 +43,17 @@ func (s Select) MergeClause(clause *Clause) {
clause.Expression = s
}
}
// CommaExpression represents a group of expressions separated by commas.
type CommaExpression struct {
Exprs []Expression
}
func (comma CommaExpression) Build(builder Builder) {
for idx, expr := range comma.Exprs {
if idx > 0 {
_, _ = builder.WriteString(", ")
}
expr.Build(builder)
}
}