squeal-postgresql-0.5.2.0: Squeal PostgreSQL Library

Copyright(c) Eitan Chatav 2019
Maintainereitan@morphism.tech
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Squeal.PostgreSQL.Expression.Text

Description

String functions and operators

Synopsis

Documentation

lower :: null PGtext :--> null PGtext Source #

>>> printSQL $ lower "ARRRGGG"
lower(E'ARRRGGG')

upper :: null PGtext :--> null PGtext Source #

>>> printSQL $ upper "eeee"
upper(E'eeee')

charLength :: null PGtext :--> null PGint4 Source #

>>> printSQL $ charLength "four"
char_length(E'four')

like :: Operator (null PGtext) (null PGtext) (Null PGbool) Source #

The like expression returns true if the string matches the supplied pattern. If pattern does not contain percent signs or underscores, then the pattern only represents the string itself; in that case like acts like the equals operator. An underscore (_) in pattern stands for (matches) any single character; a percent sign (%) matches any sequence of zero or more characters.

>>> printSQL $ "abc" `like` "a%"
(E'abc' LIKE E'a%')

ilike :: Operator (null PGtext) (null PGtext) (Null PGbool) Source #

The key word ILIKE can be used instead of LIKE to make the match case-insensitive according to the active locale.

>>> printSQL $ "abc" `ilike` "a%"
(E'abc' ILIKE E'a%')