Skip to content

Commit

Permalink
Add generic operator method to Chain
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenafamo committed Nov 15, 2023
1 parent 035233e commit f464a87
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions expr/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ func (x Chain[T, B]) IsNotNull() T {
return X[T, B](Join{Exprs: []bob.Expression{x.Base, isNotNull}})
}

// Generic Operator
func (x Chain[T, B]) OP(op string, target bob.Expression) T {
return X[T, B](leftRight{left: x.Base, right: target, operator: op})
}

// Equal
func (x Chain[T, B]) EQ(target bob.Expression) T {
return X[T, B](leftRight{left: x.Base, right: target, operator: "="})
Expand Down

0 comments on commit f464a87

Please sign in to comment.