on dev help sign in
Merge pull request #72 from Raveline/add-ilike
6c4e1f9Eitan Chatav
squeal-postgresql/src/Squeal/PostgreSQL/Expression.hs+14
@@ -88,6 +88,7 @@ module Squeal.PostgreSQL.Expression
88 , upper
88 , upper
89 , charLength
89 , charLength
90 , like
90 , like
91+ , ilike
91 -- ** Json
92 -- ** Json
92 -- *** Json and Jsonb operators
93 -- *** Json and Jsonb operators
93 , (.->)
94 , (.->)
@@ -955,6 +956,19 @@ like
955 -> Expression schema from grouping params (nullity 'PGbool)
956 -> Expression schema from grouping params (nullity 'PGbool)
956like = unsafeBinaryOp "LIKE"
957like = unsafeBinaryOp "LIKE"
957
958
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+
958{-----------------------------------------
972{-----------------------------------------
959 -- json and jsonb support
973 -- json and jsonb support
960
974