on dev help sign in
Merge pull request #72 from Raveline/add-ilike

Add the `ilike` function

commit6c4e1f9313e32489a630bd92799961f400bfe748 authorEitan Chatav <eitan.chatav@gmail.com> dateTue 27 Nov 2018, 08:53 (8 years ago) parenta67e103aacc89d
1 file changed+14
squeal-postgresql/src/Squeal/PostgreSQL/Expression.hs+14
squeal-postgresql/src/Squeal/PostgreSQL/Expression.hs+14
@@ -88,6 +88,7 @@ module Squeal.PostgreSQL.Expression
8888 , upper
8989 , charLength
9090 , like
91+ , ilike
9192 -- ** Json
9293 -- *** Json and Jsonb operators
9394 , (.->)
@@ -955,6 +956,19 @@ like
955956 -> Expression schema from grouping params (nullity 'PGbool)
956957like = unsafeBinaryOp "LIKE"
957958
959+-- | The key word ILIKE can be used instead of LIKE to make the
960+-- match case-insensitive according to the active locale.
961+--
962+-- >>> printSQL $ "abc" `ilike` "a%"
963+-- (E'abc' ILIKE E'a%')
964+ilike
965+ :: Expression schema from grouping params (nullity 'PGtext)
966+ -- ^ string
967+ -> Expression schema from grouping params (nullity 'PGtext)
968+ -- ^ pattern
969+ -> Expression schema from grouping params (nullity 'PGbool)
970+ilike = unsafeBinaryOp "ILIKE"
971+
958972{-----------------------------------------
959973 -- json and jsonb support
960974