Mixin: TableOrdering

TableOrdering

TableOrdering mixin.
Source:

Methods

orderBy(SortExprStropt) → {TableOrdering}

Add ORDER BY clause (set the order options of the result set).
Parameters:
Name Type Attributes Description
SortExprStr string | Array.<string> <optional>
columns (and direction) to sort
Source:
Throws:
When an expression is invalid.
Type
Error
Returns:
The query instance.
Type
TableOrdering
Example
// arguments as columns (and direction) to sort
const query = table.select('foo', 'bar').orderBy('foo asc', 'bar desc')

// array of columns (and direction) to sort
const query = table.select('foo', 'bar').orderBy(['foo asc', 'bar desc'])