Represents a column/expression to order the result set by.

Extends Static Properties
PropertyTypeDefault ValueDescription
INVERT_NULLSObject {first:"last", last:"first"}

Hash that contains the inversions for "first" and "last".

Instance Properties
PropertyTypeDefault ValueDescription
descendingBooleantrue

READ ONLY true if decending, false otherwise.

expression

READ ONLY the expression to order.

nullsStringnull

if value is "first" the null values will be first, if "last" then null values will be last

Constructor

Defined sql.js Source
function (expression,descending,opts){
   descending = isBoolean(descending) ? descending : true;
   opts = opts || {};
   this.__expression = expression;
   this.__descending = descending;
   var nulls = isString(opts) ? opts : opts.nulls;
   this.__nulls = isString(nulls) ? nulls.toLowerCase() : null;
           
}
            

asc Function Public


Defined sql.js

Returns Source
function (){
   return new OrderedExpression(this.__expression, false, {nulls: this.__nulls});
           
}
    

desc Function Public


Defined sql.js

Returns Source
function (){
   return new OrderedExpression(this.__expression, true, {nulls: this.__nulls});
           
}
    

invert Function Public


Defined sql.js

*

Returns Source
function (){
   return new OrderedExpression(this.__expression, !this.__descending, {nulls: this._static.INVERT_NULLS[this.__nulls] || this.__nulls});
           
}
    

toString Function Public


Defined sql.js

Converts the patio.sql.OrderedExpression to a string.

Arguments Returns Source
function (ds){
   !Dataset && (Dataset = require("./dataset"));
   ds = ds || new Dataset();
   return ds.orderedExpressionSql(this);
           
}
    

Documentation generated using coddoc.