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 2901730 commit b81d7c1
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 b81d7c1

Please sign in to comment.