Keep only the rows of a query satisfying a given condition, using an
SQL WHERE clause. It is equivalent to the Haskell function
where_ :: Bool -> [()]
where_ True = [()]
where_ False = []
:: a typeCtrl KGHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19
Moduleopaleye-0.10.8.0Haskell2010
Keep only the rows of a query satisfying a given condition, using an
SQL WHERE clause. It is equivalent to the Haskell function
where_ :: Bool -> [()]
where_ True = [()]
where_ False = []
Add a WHERE EXISTS clause to the current query.
Add a WHERE NOT EXISTS clause to the current query.
Numeric Column / Field types are instances of Num
and Fractional, so you can use the standard Haskell numerical
operators (e.g.. *, /, +, -) on them and you can create
them with numerical literals such as 3.14 :: Field SqlFloat8.
Fractional division.
Conversion from an Integer.
An integer literal represents the application of the function
fromInteger to the appropriate value of type Integer,
so such literals have type (Num a) => a.
Absolute value.
Unary negation.
A polymorphic equality operator that works for all types that you
have run makeAdaptorAndInstanceInferrable on. This may be unified with
.== in a future version.
A polymorphic inequality operator that works for all types that
you have run makeAdaptorAndInstanceInferrable on. This may be unified with
./= in a future version.
Integral division, named after quot. It maps to the
/ operator in Postgres.
The remainder of integral division, named after rem.
It maps to MOD (%) in Postgres, confusingly described as
"modulo (remainder)".
Select the first case for which the condition is true.
Monomorphic if/then/else.
This may be replaced by ifThenElseMany in a future version.
Polymorphic if/then/else.
Boolean or
Boolean and
Boolean not
True when any element of the container is true
To lowercase
To uppercase
Postgres LIKE operator
Postgres ILIKE operator
inMany is a generalization of in_ to values with multiple
fields. It is designed to be used in prefix form.
inMany validUsers user checks whether user is a valid user.
inMany validUsers is a function which checks whether a user is a
valid user.
True if the first argument occurs amongst the rows of the second, false otherwise.
This operation is equivalent to Postgres's IN operator.
Class of Postgres types that can be used to index json values.
Warning: making additional instances of this class can lead to broken code!
SqlJsonIndex SqlInt4Defined in opaleye-0.10.8.0 · Opaleye.OperatorsSqlJsonIndex SqlInt8Defined in opaleye-0.10.8.0 · Opaleye.OperatorsSqlJsonIndex SqlTextDefined in opaleye-0.10.8.0 · Opaleye.OperatorsUse SqlJsonIndex instead. Will be deprecated in a future version.
(.->) :: (SqlIsJson json, SqlJsonIndex k)=> FieldNullable json-> Field kkey or index
-> FieldNullable jsonGet JSON object field by key.
(.->>) :: (SqlIsJson json, SqlJsonIndex k)=> FieldNullable json-> Field kkey or index
-> FieldNullable SqlTextGet JSON object field as text.
(.#>) :: SqlIsJson json=> FieldNullable json-> Field (SqlArray SqlText)path
-> FieldNullable jsonGet JSON object at specified path.
(.#>>) :: SqlIsJson json=> FieldNullable json-> Field (SqlArray SqlText)path
-> FieldNullable SqlTextGet JSON object at specified path as text.
Does the left JSON value contain within it the right value?
Is the left JSON value contained within the right value?
Does the key/element string exist within the JSON value?
Do any of these key/element strings exist?
Do all of these key/element strings exist?
Create an SqlJson object from a collection of fields.
Note: This is implemented as a variadic function in postgres, and as such, is limited to 50 arguments, or 25 key-value pairs.
Given a label and a field, generates a pair for use with jsonBuildObject
Combine JSONBuildObjectFields using (<>)
Semigroup JSONBuildObjectFieldsDefined in opaleye-0.10.8.0 · Opaleye.Internal.JSONBuildObjectFieldsMonoid JSONBuildObjectFieldsDefined in opaleye-0.10.8.0 · Opaleye.Internal.JSONBuildObjectFieldsAppend two SqlArrays
Prepend an element to a SqlArray
Remove all instances of an element from a SqlArray
Remove all NULL values from a SqlArray
Postgres's array_position
Whether the element (needle) exists in the array (haystack).
N.B. this is implemented hackily using array_position. If you
want the equivalent implemented using = any then use
sqlElemAny.
Whether the element (needle) exists in the array (haystack).
This is implemented using = any.
Access the upper bound of a range. For discrete range types it is the exclusive bound.
Access the lower bound of a range. For discrete range types it is the inclusive bound.
Current date and time (start of current transaction)
IntervalNum from to determines from which date or time types an interval
can be added (addInterval) or subtracted (minusInterval) and which is the
resulting type.
The instances should correspond to the interval + and - operations listed in:
https://www.postgresql.org/docs/current/functions-datetime.html#OPERATORS-DATETIME-TABLE
IntervalNum SqlDate SqlTimestampDefined in opaleye-0.10.8.0 · Opaleye.OperatorsIntervalNum SqlInterval SqlIntervalDefined in opaleye-0.10.8.0 · Opaleye.OperatorsIntervalNum SqlTime SqlTimeDefined in opaleye-0.10.8.0 · Opaleye.OperatorsIntervalNum SqlTimestamp SqlTimestampDefined in opaleye-0.10.8.0 · Opaleye.OperatorsIntervalNum SqlTimestamptz SqlTimestamptzDefined in opaleye-0.10.8.0 · Opaleye.OperatorsShow TimestampPrecisionDefined in opaleye-0.10.8.0 · Opaleye.Operators