Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Order a = Order (a -> [(OrderOp, PrimExpr)])
- order :: OrderOp -> (a -> Column b) -> Order a
- orderByU :: Order a -> (a, PrimQuery, Tag) -> (a, PrimQuery, Tag)
- orderExprs :: a -> Order a -> [OrderExpr]
- limit' :: Int -> (a, PrimQuery, Tag) -> (a, PrimQuery, Tag)
- offset' :: Int -> (a, PrimQuery, Tag) -> (a, PrimQuery, Tag)
- distinctOn :: Unpackspec b b -> (a -> b) -> (a, PrimQuery, Tag) -> (a, PrimQuery, Tag)
- distinctOnBy :: Unpackspec b b -> (a -> b) -> Order a -> (a, PrimQuery, Tag) -> (a, PrimQuery, Tag)
- exact :: [Column b] -> (a -> Column b) -> Order a
Documentation
An Order
a
represents a sort order and direction for the elements
of the type a
. Multiple Order
s can be composed with
mappend
or (<>)
from Data.Monoid. If two rows are
equal according to the first Order
in the mappend
, the second is
used, and so on.
orderExprs :: a -> Order a -> [OrderExpr] Source #
distinctOn :: Unpackspec b b -> (a -> b) -> (a, PrimQuery, Tag) -> (a, PrimQuery, Tag) Source #
distinctOnBy :: Unpackspec b b -> (a -> b) -> Order a -> (a, PrimQuery, Tag) -> (a, PrimQuery, Tag) Source #
exact :: [Column b] -> (a -> Column b) -> Order a Source #
Order the results of a given query exactly, as determined by the given list of input columns. Note that this list does not have to contain an entry for every result in your query: you may exactly order only a subset of results, if you wish. Rows that are not ordered according to the input list are returned after the ordered results, in the usual order the database would return them (e.g. sorted by primary key). Exactly-ordered results always come first in a result set. Entries in the input list that are not present in result of a query are ignored.