From f48970d124136456f346900c57ad708f710c7cc8 Mon Sep 17 00:00:00 2001 From: Mathieu Kooiman Date: Fri, 12 Jul 2024 14:09:17 +0200 Subject: [PATCH] refactor: expose NewCustomExpression for dialects to use --- internal/jet/expression.go | 2 +- internal/jet/func_expression.go | 2 +- internal/jet/group_by_clause.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/jet/expression.go b/internal/jet/expression.go index d62920c..aedb555 100644 --- a/internal/jet/expression.go +++ b/internal/jet/expression.go @@ -278,7 +278,7 @@ type customExpression struct { parts []Serializer } -func newCustomExpression(parts ...Serializer) Expression { +func NewCustomExpression(parts ...Serializer) Expression { ret := customExpression{ parts: parts, } diff --git a/internal/jet/func_expression.go b/internal/jet/func_expression.go index 6036b8d..43c7ec3 100644 --- a/internal/jet/func_expression.go +++ b/internal/jet/func_expression.go @@ -548,7 +548,7 @@ func TO_TIMESTAMP(timestampzStr, format StringExpression) TimestampzExpression { // EXTRACT extracts time component from time 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 diff --git a/internal/jet/group_by_clause.go b/internal/jet/group_by_clause.go index 5f0c4b1..59e244b 100644 --- a/internal/jet/group_by_clause.go +++ b/internal/jet/group_by_clause.go @@ -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. // It creates extra rows in the result set that represent the subtotal values for each combination of columns. func WITH_ROLLUP(expressions ...Expression) GroupByClause { - return newCustomExpression( + return NewCustomExpression( parametersSerializer(expressions), Token("WITH ROLLUP"), ) }