squeal-postgresql-0.5.1.0: Squeal PostgreSQL Library

Copyright(c) Eitan Chatav 2019
Maintainereitan@morphism.tech
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Squeal.PostgreSQL.Expression.Sort

Description

Sort expressions

Synopsis

Documentation

data SortExpression outer commons grp schemas params from where Source #

SortExpressions are used by orderBy to optionally sort the results of a Query. Asc or Desc set the sort direction of a NotNull result column to ascending or descending. Ascending order puts smaller values first, where "smaller" is defined in terms of the .< operator. Similarly, descending order is determined with the .> operator. AscNullsFirst, AscNullsLast, DescNullsFirst and DescNullsLast options are used to determine whether nulls appear before or after non-null values in the sort ordering of a Null result column.

Constructors

Asc :: Expression outer commons grp schemas params from (NotNull ty) -> SortExpression outer commons grp schemas params from 
Desc :: Expression outer commons grp schemas params from (NotNull ty) -> SortExpression outer commons grp schemas params from 
AscNullsFirst :: Expression outer commons grp schemas params from (Null ty) -> SortExpression outer commons grp schemas params from 
AscNullsLast :: Expression outer commons grp schemas params from (Null ty) -> SortExpression outer commons grp schemas params from 
DescNullsFirst :: Expression outer commons grp schemas params from (Null ty) -> SortExpression outer commons grp schemas params from 
DescNullsLast :: Expression outer commons grp schemas params from (Null ty) -> SortExpression outer commons grp schemas params from 
Instances
Show (SortExpression outer commons grp schemas params from) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Sort

Methods

showsPrec :: Int -> SortExpression outer commons grp schemas params from -> ShowS #

show :: SortExpression outer commons grp schemas params from -> String #

showList :: [SortExpression outer commons grp schemas params from] -> ShowS #

RenderSQL (SortExpression outer commons grp schemas params from) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Sort

Methods

renderSQL :: SortExpression outer commons grp schemas params from -> ByteString Source #

class OrderBy expr where Source #

The orderBy clause causes the result rows of a TableExpression to be sorted according to the specified SortExpression(s). If two rows are equal according to the leftmost expression, they are compared according to the next expression and so on. If they are equal according to all specified expressions, they are returned in an implementation-dependent order.

You can also control the order in which rows are processed by window functions using orderBy within Over.

Methods

orderBy :: [SortExpression outer commons grp schemas params from] -> expr outer commons grp schemas params from -> expr outer commons grp schemas params from Source #

Instances
OrderBy WindowDefinition Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Window

Methods

orderBy :: [SortExpression outer commons grp schemas params from] -> WindowDefinition outer commons grp schemas params from -> WindowDefinition outer commons grp schemas params from Source #

OrderBy TableExpression Source # 
Instance details

Defined in Squeal.PostgreSQL.Query

Methods

orderBy :: [SortExpression outer commons grp schemas params from] -> TableExpression outer commons grp schemas params from -> TableExpression outer commons grp schemas params from Source #