Skip to content

Commit

Permalink
Merge pull request #339 from kblomster/expose-binary-operator
Browse files Browse the repository at this point in the history
Export BinaryOperator function
  • Loading branch information
go-jet committed Mar 28, 2024
2 parents 1fd423b + 1d31062 commit b13f6ab
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/jet/operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,7 @@ func (c *caseOperatorImpl) serialize(statement StatementType, out *SQLBuilder, o
func DISTINCT(expr Expression) Expression {
return newPrefixOperatorExpression(expr, "DISTINCT")
}

func BinaryOperator(lhs Expression, rhs Expression, operator string) Expression {
return NewBinaryOperatorExpression(lhs, rhs, operator)
}
3 changes: 3 additions & 0 deletions mysql/expressions.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,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
3 changes: 3 additions & 0 deletions postgres/expressions.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,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
3 changes: 3 additions & 0 deletions sqlite/expressions.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,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

0 comments on commit b13f6ab

Please sign in to comment.