Defines case methods

Constructor

Defined sql.js Source
define({
            

cast Function Public


Defined sql.js

Cast the reciever to the given SQL type.

Example
sql.a.cast("integer") //=> CAST(a AS integer)
sql.a.cast(String) //=> CAST(a AS varchar(255))
        
Arguments Returns Source
function (type){
   return new Cast(this, type);
           
}
    

castNumeric Function Public


Defined sql.js

Cast the reciever to the given SQL type (or the database's default Number type if none given.

Example
sql.a.castNumeric() //=> CAST(a AS integer)
sql.a.castNumeric("double") //=> CAST(a AS double precision)
        
Arguments Returns Source
function (type){
   return this.cast(type || "integer").sqlNumber;
           
}
    

castString Function Public


Defined sql.js

Cast the reciever to the given SQL type (or the database's default String type if none given), and return the result as a patio.sql.StringExpression.

Example
sql.a.castString() //=> CAST(a AS varchar(255))
 sql.a.castString("text") //=> CAST(a AS text)
        
Arguments Returns Source
function (type){
   return this.cast(type || String).sqlString;
           
}
    

Documentation generated using coddoc.