Skip to content

Commit

Permalink
Merge pull request #113 from ulule/feat/add-like-and-overlap-to-call
Browse files Browse the repository at this point in the history
feat: add Like and Overlap to Call
  • Loading branch information
yansal authored May 14, 2021
2 parents f5e1327 + f38000c commit bad047a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions stmt/expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,12 @@ func (call Call) LessThan(value interface{}) InfixExpression {
return NewInfixExpression(call, operator, NewWrapper(NewExpression(value)))
}

// Like performs a "like" condition.
func (call Call) Like(value interface{}) InfixExpression {
operator := NewComparisonOperator(types.Like)
return NewInfixExpression(call, operator, NewExpression(value))
}

// ILike performs a "ilike" condition.
func (call Call) ILike(value interface{}) InfixExpression {
operator := NewComparisonOperator(types.ILike)
Expand All @@ -546,6 +552,12 @@ func (call Call) In(value ...interface{}) In {
return NewIn(call, NewArrayExpression(value...))
}

// Overlap performs an "overlap" comparison.
func (call Call) Overlap(what interface{}) InfixExpression {
operator := NewComparisonOperator(types.Overlap)
return NewInfixExpression(call, operator, NewWrapper(NewExpression(what)))
}

// IsEmpty reports whether call is empty.
func (call Call) IsEmpty() bool {
return false
Expand Down

0 comments on commit bad047a

Please sign in to comment.