Simplify construction of new expressions.

Fixes: IS_NOT_NULL() does not always add enough parentheses to the compiled SQL #500
This commit is contained in:
go-jet 2026-02-02 13:18:19 +01:00
parent 95224a793f
commit 4995a90483
26 changed files with 466 additions and 543 deletions

View file

@ -2,8 +2,9 @@ package sqlite
import (
"fmt"
"github.com/go-jet/jet/v2/internal/jet"
"time"
"github.com/go-jet/jet/v2/internal/jet"
)
// This functions can be used, instead of its method counterparts, to have a better indentation of a complex condition
@ -297,7 +298,7 @@ func modifier(modifierName string) func(value float64) Expression {
func DATE(timeValue interface{}, modifiers ...Expression) DateExpression {
exprList := getFuncExprList(timeValue, modifiers...)
return jet.NewDateFunc("DATE", exprList...)
return DateExp(Func("DATE", exprList...))
}
// TIME function creates new time from time-value and zero or more time modifiers