refactor: NewCustomExpression -> CustomExpression

This commit is contained in:
Mathieu Kooiman 2024-07-13 17:04:33 +02:00
parent f48970d124
commit 3ec0e2cabd
3 changed files with 3 additions and 3 deletions

View file

@ -278,7 +278,7 @@ type customExpression struct {
parts []Serializer parts []Serializer
} }
func NewCustomExpression(parts ...Serializer) Expression { func CustomExpression(parts ...Serializer) Expression {
ret := customExpression{ ret := customExpression{
parts: parts, parts: parts,
} }

View file

@ -548,7 +548,7 @@ func TO_TIMESTAMP(timestampzStr, format StringExpression) TimestampzExpression {
// EXTRACT extracts time component from time expression // EXTRACT extracts time component from time expression
func EXTRACT(field string, from Expression) Expression { func EXTRACT(field string, from Expression) Expression {
return NewCustomExpression(Token("EXTRACT("), Token(field), Token("FROM"), from, Token(")")) return CustomExpression(Token("EXTRACT("), Token(field), Token("FROM"), from, Token(")"))
} }
// CURRENT_DATE returns current date // CURRENT_DATE returns current date

View file

@ -35,7 +35,7 @@ func GROUPING(expressions ...Expression) IntegerExpression {
// WITH_ROLLUP operator is used with the GROUP BY clause to generate all prefixes of a group of columns including the empty list. // WITH_ROLLUP operator is used with the GROUP BY clause to generate all prefixes of a group of columns including the empty list.
// It creates extra rows in the result set that represent the subtotal values for each combination of columns. // It creates extra rows in the result set that represent the subtotal values for each combination of columns.
func WITH_ROLLUP(expressions ...Expression) GroupByClause { func WITH_ROLLUP(expressions ...Expression) GroupByClause {
return NewCustomExpression( return CustomExpression(
parametersSerializer(expressions), Token("WITH ROLLUP"), parametersSerializer(expressions), Token("WITH ROLLUP"),
) )
} }