opaleye-0.7.3.0: An SQL-generating DSL targeting PostgreSQL
Safe HaskellNone
LanguageHaskell2010

Opaleye.Internal.Order

Synopsis

Documentation

newtype Order a Source #

An Order a represents a sort order and direction for the elements of the type a. Multiple Orders 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.

Constructors

Order (a -> [(OrderOp, PrimExpr)]) 

Instances

Instances details
Contravariant Order Source # 
Instance details

Defined in Opaleye.Internal.Order

Methods

contramap :: (a -> b) -> Order b -> Order a #

(>$) :: b -> Order b -> Order a #

Divisible Order Source # 
Instance details

Defined in Opaleye.Internal.Order

Methods

divide :: (a -> (b, c)) -> Order b -> Order c -> Order a #

conquer :: Order a #

Decidable Order Source # 
Instance details

Defined in Opaleye.Internal.Order

Methods

lose :: (a -> Void) -> Order a #

choose :: (a -> Either b c) -> Order b -> Order c -> Order a #

Semigroup (Order a) Source # 
Instance details

Defined in Opaleye.Internal.Order

Methods

(<>) :: Order a -> Order a -> Order a #

sconcat :: NonEmpty (Order a) -> Order a #

stimes :: Integral b => b -> Order a -> Order a #

Monoid (Order a) Source # 
Instance details

Defined in Opaleye.Internal.Order

Methods

mempty :: Order a #

mappend :: Order a -> Order a -> Order a #

mconcat :: [Order a] -> Order a #

order :: OrderOp -> (a -> Column b) -> Order a Source #

orderByU :: Order a -> (a, PrimQuery, Tag) -> (a, PrimQuery, Tag) Source #

limit' :: Int -> (a, PrimQuery, Tag) -> (a, PrimQuery, Tag) Source #

offset' :: Int -> (a, PrimQuery, Tag) -> (a, PrimQuery, Tag) 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.