This mixin provides ordering methods ("asc", "desc") to expression.

Example
  1. sql.name.asc(); //=> name ASC
  2. sql.price.desc(); //=> price DESC
  3. sql.name.asc({nulls:"last"}); //=> name ASC NULLS LAST
  4. sql.price.desc({nulls:"first"}); //=> price DESC NULLS FIRST

Constructor

Defined sql.js Source
  1. define({

asc Function Public


Defined sql.js

Mark the receiving SQL column as sorting in an ascending fashion (generally a no-op).

Example
  1. sql.name.asc(); //=> name ASC
  2. sql.name.asc({nulls:"last"}); //=> name ASC NULLS LAST
Arguments Returns Source
  1. function (options){
  2. return new OrderedExpression(this, false, options);
  3. }

desc Function Public


Defined sql.js

Mark the receiving SQL column as sorting in a descending fashion.

Example
  1. sql.price.desc(); //=> price DESC
  2. sql.price.desc({nulls:"first"}); //=> price DESC NULLS FIRST
Arguments Returns Source
  1. function (options){
  2. return new OrderedExpression(this, true, options);
  3. }

Documentation generated using coddoc.