| Copyright | Flipstone Technology Partners 2023 |
|---|---|
| License | MIT |
| Stability | Stable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Orville.PostgreSQL.Expr.WhereClause
Description
Since: 1.0.0.0
Synopsis
- data WhereClause
- whereClause :: BooleanExpr -> WhereClause
- data BooleanExpr
- literalBooleanExpr :: Bool -> BooleanExpr
- andExpr :: BooleanExpr -> BooleanExpr -> BooleanExpr
- (.&&) :: BooleanExpr -> BooleanExpr -> BooleanExpr
- orExpr :: BooleanExpr -> BooleanExpr -> BooleanExpr
- (.||) :: BooleanExpr -> BooleanExpr -> BooleanExpr
- parenthesized :: BooleanExpr -> BooleanExpr
- equals :: ValueExpression -> ValueExpression -> BooleanExpr
- notEquals :: ValueExpression -> ValueExpression -> BooleanExpr
- greaterThan :: ValueExpression -> ValueExpression -> BooleanExpr
- lessThan :: ValueExpression -> ValueExpression -> BooleanExpr
- greaterThanOrEqualTo :: ValueExpression -> ValueExpression -> BooleanExpr
- lessThanOrEqualTo :: ValueExpression -> ValueExpression -> BooleanExpr
- like :: ValueExpression -> ValueExpression -> BooleanExpr
- likeInsensitive :: ValueExpression -> ValueExpression -> BooleanExpr
- isNull :: ValueExpression -> BooleanExpr
- isNotNull :: ValueExpression -> BooleanExpr
- valueIn :: ValueExpression -> NonEmpty ValueExpression -> BooleanExpr
- valueNotIn :: ValueExpression -> NonEmpty ValueExpression -> BooleanExpr
- tupleIn :: NonEmpty ValueExpression -> NonEmpty (NonEmpty ValueExpression) -> BooleanExpr
- tupleNotIn :: NonEmpty ValueExpression -> NonEmpty (NonEmpty ValueExpression) -> BooleanExpr
- data InValuePredicate
- inPredicate :: ValueExpression -> InValuePredicate -> BooleanExpr
- notInPredicate :: ValueExpression -> InValuePredicate -> BooleanExpr
- inValueList :: NonEmpty ValueExpression -> InValuePredicate
Documentation
data WhereClause Source #
Type to represent a WHERE clause restriction on a SELECT, UPDATE or
DELETE statement. E.G.
WHERE (foo > 10)
WhereClause provides a SqlExpression instance. See
unsafeSqlExpression for how to construct a value with your own custom
SQL.
Since: 1.0.0.0
Instances
whereClause :: BooleanExpr -> WhereClause Source #
data BooleanExpr Source #
Type to represent a SQL value expression that evaluates to a boolean and therefore can used with boolean logic functions. E.G.
foo > 10
BooleanExpr provides a SqlExpression instance. See
unsafeSqlExpression for how to construct a value with your own custom
SQL.
Since: 1.0.0.0
Instances
literalBooleanExpr :: Bool -> BooleanExpr Source #
Constructs a BooleanExpr whose value is the SQL literal TRUE or FALSE
depending on the argument given.
Since: 1.0.0.0
andExpr :: BooleanExpr -> BooleanExpr -> BooleanExpr Source #
The SQL AND operator. The arguments will be surrounded with parentheses
to ensure that the associativity of expression in the resulting SQL matches
the associativity implied by this Haskell function.
Since: 1.0.0.0
(.&&) :: BooleanExpr -> BooleanExpr -> BooleanExpr infixr 8 Source #
The SQL AND operator (alias for andExpr).
Since: 1.0.0.0
orExpr :: BooleanExpr -> BooleanExpr -> BooleanExpr Source #
The SQL OR operator. The arguments will be surrounded with parentheses
to ensure that the associativity of expression in the resulting SQL matches
the associativity implied by this Haskell function.
Since: 1.0.0.0
(.||) :: BooleanExpr -> BooleanExpr -> BooleanExpr infixr 8 Source #
The SQL OR operator (alias for orExpr).
Since: 1.0.0.0
parenthesized :: BooleanExpr -> BooleanExpr Source #
Surrounds the given BooleanExpr with parentheses.
Since: 1.0.0.0
equals :: ValueExpression -> ValueExpression -> BooleanExpr Source #
The SQL = operator.
Since: 1.0.0.0
notEquals :: ValueExpression -> ValueExpression -> BooleanExpr Source #
The SQL <> operator.
Since: 1.0.0.0
greaterThan :: ValueExpression -> ValueExpression -> BooleanExpr Source #
The SQL > operator.
Since: 1.0.0.0
lessThan :: ValueExpression -> ValueExpression -> BooleanExpr Source #
The SQL < operator.
Since: 1.0.0.0
greaterThanOrEqualTo :: ValueExpression -> ValueExpression -> BooleanExpr Source #
The SQL >= operator.
Since: 1.0.0.0
lessThanOrEqualTo :: ValueExpression -> ValueExpression -> BooleanExpr Source #
The SQL <= operator.
Since: 1.0.0.0
like :: ValueExpression -> ValueExpression -> BooleanExpr Source #
The SQL LIKE operator.
Since: 1.0.0.0
likeInsensitive :: ValueExpression -> ValueExpression -> BooleanExpr Source #
The SQL ILIKE operator.
Since: 1.0.0.0
isNull :: ValueExpression -> BooleanExpr Source #
The SQL IS NULL condition.
Since: 1.0.0.0
isNotNull :: ValueExpression -> BooleanExpr Source #
The SQL IS NOT NULL condition.
Since: 1.0.0.0
valueIn :: ValueExpression -> NonEmpty ValueExpression -> BooleanExpr Source #
The SQL IN operator. The result will be TRUE if the given value
appears in the list of values given.
Since: 1.0.0.0
valueNotIn :: ValueExpression -> NonEmpty ValueExpression -> BooleanExpr Source #
The SQL NOT IN operator. The result will be TRUE if the given value
does not appear in the list of values given.
Since: 1.0.0.0
tupleIn :: NonEmpty ValueExpression -> NonEmpty (NonEmpty ValueExpression) -> BooleanExpr Source #
The SQL IN operator, like valueIn, but for when you want to construct a
tuple in SQL and check if it is in a list of tuples. It is up to the caller
to ensure that all the tuples given have the same arity.
Since: 1.0.0.0
tupleNotIn :: NonEmpty ValueExpression -> NonEmpty (NonEmpty ValueExpression) -> BooleanExpr Source #
The SQL NOT IN operator, like valueNotIn, but for when you want to
construct a tuple in SQL and check if it is not in a list of tuples. It is up
to the caller to ensure that all the tuples given have the same arity.
Since: 1.0.0.0
data InValuePredicate Source #
Type to represent the right hand side of an IN or NOT IN expression.
E.G.
(10,12,13)
InValuePredicate provides a SqlExpression instance. See
unsafeSqlExpression for how to construct a value with your own custom
SQL.
Since: 1.0.0.0
Instances
| SqlExpression InValuePredicate Source # | |
Defined in Orville.PostgreSQL.Expr.WhereClause Methods toRawSql :: InValuePredicate -> RawSql Source # | |
inPredicate :: ValueExpression -> InValuePredicate -> BooleanExpr Source #
Lower-level access to the SQL IN operator. This takes any ValueExpression
and InValuePredicate. It is up to the caller to ensure the expressions
given make sense together.
Since: 1.0.0.0
notInPredicate :: ValueExpression -> InValuePredicate -> BooleanExpr Source #
Lower-level access to the SQL NOT IN operator. This takes any
ValueExpression and InValuePredicate. It is up to the caller to ensure
the expressions given make sense together.
Since: 1.0.0.0
inValueList :: NonEmpty ValueExpression -> InValuePredicate Source #
Constructs an InValuePredicate from the given list of ValueExpression.
Since: 1.0.0.0