on dev help sign in
Add the `ilike` function
commitaacc89d27d4d3b4892d3d0b8364905bbf3837d9d authorRaveline <eraveline@gmail.com> dateTue 27 Nov 2018, 15:38 (8 years ago) parenta67e103
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