Lit : (t : SqliteType) -> IdrisType t -> Expr s t A literal value in an SQL expression
NULL : Expr s t The `NULL` literal
TRUE : Expr s BOOL Alias for the literal `1`, which corresponds to `True` in
boolean expressions
FALSE : Expr s BOOL Alias for the literal `0`, which corresponds to `False` in
boolean expressions
Raw : String -> Expr s t A raw expressions string that will be used as given.
Col : (col : String) -> {auto 0 p : IsJust (FindSchemaCol col s)} -> Expr s (SchemaColType col s) A column in a list of tables. Typically, it is convenient to
use string literals directly for this (see `Expr.fromString`).
(>) : Expr s t -> Expr s t -> Expr s BOOL Greater-than operator.
Note, that this is subject to SQL's three-valued logic in the
presence of `NULL`.
(<) : Expr s t -> Expr s t -> Expr s BOOL Less-than operator.
Note, that this is subject to SQL's three-valued logic in the
presence of `NULL`.
(>=) : Expr s t -> Expr s t -> Expr s BOOL Greater-than or equals operator.
Note, that this is subject to SQL's three-valued logic in the
presence of `NULL`.
(<=) : Expr s t -> Expr s t -> Expr s BOOL Less-than or equals operator.
Note, that this is subject to SQL's three-valued logic in the
presence of `NULL`.
(==) : Expr s t -> Expr s t -> Expr s BOOL Equality operator.
Note, that this is subject to SQL's three-valued logic in the
presence of `NULL`.
(/=) : Expr s t -> Expr s t -> Expr s BOOL Inequality operator.
We use the same operator as in the `Eq` interface here, but this
corresponds to SQL's `<>` (or `!=`) operator.
Note, that this is subject to SQL's three-valued logic in the
presence of `NULL`.
IS : Expr s t -> Expr s t -> Expr s BOOL Equality test.
Unlike `(==)`, this will always result in `TRUE` or `FALSE`
even in the presence of `NULL`.
IS_NOT : Expr s t -> Expr s t -> Expr s BOOL Inequality test.
Unlike `(==)`, this will always result in `TRUE` or `FALSE`
even in the presence of `NULL`.
(&&) : Expr s BOOL -> Expr s BOOL -> Expr s BOOL Logical `AND`.
Note, that this is subject to SQL's three-valued logic in the
presence of `NULL`.
(||) : Expr s BOOL -> Expr s BOOL -> Expr s BOOL Logical `OR`.
Note, that this is subject to SQL's three-valued logic in the
presence of `NULL`.
NOT : Expr s BOOL -> Expr s BOOL Logical negation.
Note, that this is subject to SQL's three-valued logic in the
presence of `NULL`.
(.&.) : Expr s INTEGER -> Expr s INTEGER -> Expr s INTEGER Bit-wise `AND`.
This corresponds to SQLite's `&` operator.
(.|.) : Expr s INTEGER -> Expr s INTEGER -> Expr s INTEGER Bit-wise `OR`.
This corresponds to SQLite's `|` operator.
ShiftL : Expr s INTEGER -> Expr s INTEGER -> Expr s INTEGER Bit-wise left shift.
This corresponds to SQLite's `<<` operator.
ShiftR : Expr s INTEGER -> Expr s INTEGER -> Expr s INTEGER Bit-wise right shift.
This corresponds to SQLite's `>>` operator.
Add : {auto 0 _ : Numeric t} -> Expr s t -> Expr s t -> Expr s t Numeric addition.
Since `Expr s t` implements `Num` for numeric types `t`, you can
typically use the addition operator `(+)` instead of this constructor.
Mult : {auto 0 _ : Numeric t} -> Expr s t -> Expr s t -> Expr s t Numeric multiplication.
Since `Expr s t` implements `Num` for numeric types `t`, you can
typically use the multiplication operator `(*)` instead of this
constructor.
Sub : {auto 0 _ : Numeric t} -> Expr s t -> Expr s t -> Expr s t Numeric subtraction.
Since `Expr s t` implements `Neg` for numeric types `t`, you can
typically use the subtraction operator `(-)` instead of this
constructor.
Abs : {auto 0 _ : Numeric t} -> Expr s t -> Expr s t Computes the absolute of an expressions.
This corresponds to the `abs()` function.
Neg : {auto 0 _ : Numeric t} -> Expr s t -> Expr s t Numeric negation.
Div : {auto 0 _ : Numeric t} -> Expr s t -> Expr s t -> Expr s t Numeric division.
Since `Expr s t` implements `Integral` for numeric types `INTEGER`,
you can typically use `div` for integer division. Likewise, you can
use `(/)` for floating point division.
Mod : Expr s INTEGER -> Expr s INTEGER -> Expr s INTEGER Computes the modulus of two integers.
This corresponds to the `%` operator in SQL.
(++) : Expr s TEXT -> Expr s TEXT -> Expr s TEXT String concatenation.
This corresponds to the `||` operator in SQL.
CURRENT_TIME : Expr s TEXT The current time as a string.
CURRENT_DATE : Expr s TEXT The current date as a string.
CURRENT_TIMESTAMP : Expr s TEXT The current date and time as a string.
LIKE : Expr s TEXT -> Expr s TEXT -> Expr s BOOL Matches the given text expression against the given
text pattern.
GLOB : Expr s TEXT -> Expr s TEXT -> Expr s BOOL Matches the given text expression against the given
GLOB pattern.
IN : Expr s t -> List (Expr s t) -> Expr s BOOL True, if the given value appears in the given list of values.
COALESCE : List (Expr s t) -> Expr s t Returns the first non-NULL value in the given list of expressions.
COUNT : Expr s t -> Expr s INTEGER Counts the number of aggregated values.
This is typically used with a `GROUP BY` statement.
AVG : {auto 0 _ : Numeric t} -> Expr s t -> Expr s REAL Returns the average of accumulated values.
This is typically used with a `GROUP BY` statement.
SUM : {auto 0 _ : Numeric t} -> Expr s t -> Expr s t Returns the sum of accumulated values.
This is typically used with a `GROUP BY` statement.
MIN : Expr s t -> Expr s t Returns the minimum of accumulated values.
This is typically used with a `GROUP BY` statement.
MAX : Expr s t -> Expr s t Returns the maximum of accumulated values.
This is typically used with a `GROUP BY` statement.
GROUP_CONCAT : Expr s TEXT -> String -> Expr s TEXT Concatenates aggregated text values using the given separator.
This is typically used with a `GROUP BY` statement.