Merge remote-tracking branch 'upstream/master' into stmt-cache

This commit is contained in:
go-jet 2024-07-30 14:11:24 +02:00
commit adfa331ece
21 changed files with 218 additions and 54 deletions

View file

@ -73,6 +73,12 @@ var DateTimeExp = jet.TimestampExp
// Does not add sql cast to generated sql builder output.
var TimestampExp = jet.TimestampExp
// CustomExpression is used to define custom expressions.
var CustomExpression = jet.CustomExpression
// Token is used to define custom token in a custom expression.
type Token = jet.Token
// RawArgs is type used to pass optional arguments to Raw method
type RawArgs = map[string]interface{}
@ -96,3 +102,6 @@ var Func = jet.Func
// NewEnumValue creates new named enum value
var NewEnumValue = jet.NewEnumValue
// BinaryOperator can be used to use custom or unsupported operators that take two operands.
var BinaryOperator = jet.BinaryOperator

View file

@ -2,6 +2,7 @@ package sqlite
import (
"github.com/go-jet/jet/v2/internal/jet"
"github.com/go-jet/jet/v2/internal/utils/is"
)
type onConflict interface {
@ -37,7 +38,7 @@ func (o *onConflictClause) DO_UPDATE(action conflictAction) InsertStatement {
}
func (o *onConflictClause) Serialize(statementType jet.StatementType, out *jet.SQLBuilder, options ...jet.SerializeOption) {
if len(o.indexExpressions) == 0 && o.do == nil {
if is.Nil(o.do) {
return
}