github ↗
docs menu

Module Talon.Order

Sort keys.

A sort key names a column, a direction and where its nulls go. Query.sort and Expr.over's ~order take a list of keys, compared in turn; a source's ~sorted claim is one.

Each key orders by talon's total order (see Type.compare_value): ascending puts NaN after every number, and descending reverses it, putting NaN first. Nulls go last in both directions unless nulls_first.

#type t

The type for sort keys.

#val asc : string -> t

asc name orders the column name ascending, nulls last.

#val desc : string -> t

desc name orders the column name descending, nulls last.

#val nulls_first : t -> t

nulls_first k is k with its nulls before every value.