An Ordera 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.
Limit the results of the given Select to the given maximum number of
items.
WARNING: If you're planning on using limit/offset together please use
offsetbefore you use limit, e.g.:
limit 10 (offset 50 yourSelect)
This is because Opaleye applies OFFSET and LIMIT to the SELECT separately.
The result of the Select given above is the following, which will return
10 rows after skipping the first 50 (probably what you want).
SELECT * FROM (SELECT * FROM yourTable OFFSET 50) LIMIT 10
However, reversing the order of the limit/offset will result in the
following, which will result in no rows being returned (probably
not what you want).
SELECT * FROM (SELECT * FROM yourTable LIMIT 10) OFFSET 50
Keep a row from each set where the given function returns the same result. No
ordering is guaranteed. Multiple fields may be distinguished by projecting out
tuples of Field_s. Use distinctOnBy to control how the rows
are chosen.
Keep the row from each set where the given function returns the same result. The
row is chosen according to which comes first by the supplied ordering. However, no
output ordering is guaranteed. Multiple fields may be distinguished by projecting
out tuples of Field_s.
Order the results of a given query exactly, as determined by the given list
of input fields. 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.