refactor: expose NewCustomExpression for dialects to use
This commit is contained in:
parent
093f895db2
commit
f48970d124
3 changed files with 3 additions and 3 deletions
|
|
@ -278,7 +278,7 @@ type customExpression struct {
|
||||||
parts []Serializer
|
parts []Serializer
|
||||||
}
|
}
|
||||||
|
|
||||||
func newCustomExpression(parts ...Serializer) Expression {
|
func NewCustomExpression(parts ...Serializer) Expression {
|
||||||
ret := customExpression{
|
ret := customExpression{
|
||||||
parts: parts,
|
parts: parts,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 NewCustomExpression(Token("EXTRACT("), Token(field), Token("FROM"), from, Token(")"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// CURRENT_DATE returns current date
|
// CURRENT_DATE returns current date
|
||||||
|
|
|
||||||
|
|
@ -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 NewCustomExpression(
|
||||||
parametersSerializer(expressions), Token("WITH ROLLUP"),
|
parametersSerializer(expressions), Token("WITH ROLLUP"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue