Skip to content

Commit

Permalink
Add ILIKE ANY
Browse files Browse the repository at this point in the history
This commit adds the ability to use ILIKE ANY to find case-insensitive
values.

Example: q.Where(
	sqlz.LikeAny(mySlice,sqlz.Indirect("myColumn")),
)
  • Loading branch information
chenco47 authored and ido50 committed Oct 9, 2023
1 parent ca35964 commit 9605fd9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sqlz.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ func LikeAny(arr interface{}, value interface{}) ArrayCondition {
return ArrayCondition{value, "LIKE", "ANY", arr}
}

// ILikeAny creates an "ILikeAny ANY" condition on an array
func ILikeAny(arr interface{}, value interface{}) ArrayCondition {
return ArrayCondition{value, "ILIKE", "ANY", arr}
}

func NotLikeAll(arr interface{}, value interface{}) ArrayCondition {
return ArrayCondition{value, "NOT LIKE", "ALL", arr}
}
Expand Down

0 comments on commit 9605fd9

Please sign in to comment.