orville-postgresql-1.0.0.0: A Haskell library for PostgreSQL
CopyrightFlipstone Technology Partners 2023
LicenseMIT
StabilityStable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Orville.PostgreSQL.Expr.OrderBy

Description

Since: 1.0.0.0

Synopsis

Documentation

data OrderByClause Source #

Type to represent a SQL order by clause. E.G.

ORDER BY foo, bar

OrderByClause provides a SqlExpression instance. See unsafeSqlExpression for how to construct a value with your own custom SQL.

Since: 1.0.0.0

data OrderByExpr Source #

Type to represent a SQL order by expression (the part that follows the ORDER BY in SQL). E.G.

foo, bar

OrderByExpr provides a SqlExpression instance. See unsafeSqlExpression for how to construct a value with your own custom SQL.

Since: 1.0.0.0

appendOrderByExpr :: OrderByExpr -> OrderByExpr -> OrderByExpr Source #

Combines two OrderByExprs with a comma between them.

Since: 1.0.0.0

orderByColumnsExpr :: NonEmpty (ColumnName, OrderByDirection) -> OrderByExpr Source #

Create an OrderByExpr for ColumnName and OrderByDirection pairs, ensuring commas as needed.

Since: 1.0.0.0

data OrderByDirection Source #

Type to represent a SQL order by direction expression. E.G.

ASC

OrderByDirection provides a SqlExpression instance. See unsafeSqlExpression for how to construct a value with your own custom SQL.

Since: 1.0.0.0

data NullsOrder Source #

Type to represent the ordering of Null, intended to be used with OrderByDirection.

Since: 1.0.0.0

Constructors

NullsFirst 
NullsLast 

ascendingOrder :: OrderByDirection Source #

The SQL ASC order direction.

Since: 1.0.0.0

descendingOrder :: OrderByDirection Source #

The SQL DESC order direction.

Since: 1.0.0.0

ascendingOrderWith :: NullsOrder -> OrderByDirection Source #

The SQL ASC order direction with NULLs ordered as given.

Since: 1.0.0.0

descendingOrderWith :: NullsOrder -> OrderByDirection Source #

The SQL DESC order direction with NULLs ordered as given.

Since: 1.0.0.0