This mixin grants sorting capabilities to a table statement instance via composition.
Establishes the order of one or more specific columns in the result set. This method does not cause the statement to be executed but changes the statement boundaries, which means that if it has been prepared before, it needs to be re-prepared.
Name Type Argument Description
One or more expressions establishing the order on which the given columns are sorted.
Returns:The Instance of the statement itself following a fluent API convention.
// 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'])