squeal-postgresql-0.9.0.0: Squeal PostgreSQL Library
Copyright(c) Eitan Chatav 2019
Maintainereitan@morphism.tech
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Squeal.PostgreSQL.Expression.Sort

Contents

Description

sort expressions

Synopsis

Sort

data SortExpression grp lat with db 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 

Fields

Desc 

Fields

AscNullsFirst 

Fields

AscNullsLast 

Fields

DescNullsFirst 

Fields

DescNullsLast 

Fields

Instances

Instances details
RenderSQL [SortExpression grp lat with db params from] Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Sort

Methods

renderSQL :: [SortExpression grp lat with db params from] -> ByteString Source #

Show (SortExpression grp lat with db params from) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Sort

Methods

showsPrec :: Int -> SortExpression grp lat with db params from -> ShowS #

show :: SortExpression grp lat with db params from -> String #

showList :: [SortExpression grp lat with db params from] -> ShowS #

RenderSQL (SortExpression grp lat with db params from) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Sort

Methods

renderSQL :: SortExpression grp lat with db params from -> ByteString Source #

class OrderBy expr grp | expr -> grp 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 Source #

Arguments

:: [SortExpression grp lat with db params from]

sorts

-> expr lat with db params from 
-> expr lat with db params from 

Instances

Instances details
OrderBy (TableExpression grp) grp Source # 
Instance details

Defined in Squeal.PostgreSQL.Query.Table

Methods

orderBy :: forall (lat :: FromType) (with :: FromType) (db :: SchemasType) (params :: [NullType]) (from :: FromType). [SortExpression grp lat with db params from] -> TableExpression grp lat with db params from -> TableExpression grp lat with db params from Source #

OrderBy (AggregateArg xs) 'Ungrouped Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Aggregate

Methods

orderBy :: forall (lat :: FromType) (with :: FromType) (db :: SchemasType) (params :: [NullType]) (from :: FromType). [SortExpression 'Ungrouped lat with db params from] -> AggregateArg xs lat with db params from -> AggregateArg xs lat with db params from Source #

OrderBy (WindowDefinition grp) grp Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Window

Methods

orderBy :: forall (lat :: FromType) (with :: FromType) (db :: SchemasType) (params :: [NullType]) (from :: FromType). [SortExpression grp lat with db params from] -> WindowDefinition grp lat with db params from -> WindowDefinition grp lat with db params from Source #