| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Opaleye.Order
- orderBy :: Order a -> Query a -> Query a
- asc :: PGOrd b => (a -> Column b) -> Order a
- desc :: PGOrd b => (a -> Column b) -> Order a
- ascNullsFirst :: PGOrd b => (a -> Column b) -> Order a
- descNullsLast :: PGOrd b => (a -> Column b) -> Order a
- limit :: Int -> Query a -> Query a
- offset :: Int -> Query a -> Query a
- class PGOrd a
- data Order a
Documentation
orderBy :: Order a -> Query a -> Query a Source
Order the rows of a Query according to the Order.
import Data.Monoid (<>) -- Order by the first column ascending. When first columns are equal -- order by second column descending. example ::Query(ColumnPGInt4,ColumnPGText) ->Query(ColumnPGInt4,ColumnPGText) example =orderBy(ascfst <>descsnd)
asc :: PGOrd b => (a -> Column b) -> Order a Source
Specify an ascending ordering by the given expression. (Any NULLs appear last)
desc :: PGOrd b => (a -> Column b) -> Order a Source
Specify an descending ordering by the given expression. (Any NULLs appear first)
ascNullsFirst :: PGOrd b => (a -> Column b) -> Order a Source
Specify an ascending ordering by the given expression. (Any NULLs appear first)
descNullsLast :: PGOrd b => (a -> Column b) -> Order a Source
Specify an descending ordering by the given expression. (Any NULLs appear last)
limit :: Int -> Query a -> Query a Source
Limit the results of the given query to the given maximum number of items.
offset :: Int -> Query a -> Query a Source
Offset the results of the given query by the given amount, skipping that many result rows.
Typeclass for Postgres types which support ordering operations.