Example #1
0
 returning: function() {
   var returning = new Returning();
   var args = sliced(arguments);
   if(util.isArray(args[0])) {
     args = args[0];
   }
   returning.addAll(args);
   return this.add(returning);
 },
Example #2
0
 select: function() {
   var select = new Select();
   var args = sliced(arguments);
   if(util.isArray(args[0])) {
     args = args[0];
   }
   select.addAll(args);
   // if this is a subquery then add reference to this column
   if(this.type === 'SUBQUERY') {
     for(var j = 0; j < select.nodes.length; j++) {
       var name = select.nodes[j].alias || select.nodes[j].name;
       var col = new Column(select.nodes[j]);
       col.name = name;
       col.table = this;
       if( this[name] === undefined ) {
         this[name] = col;
       }
     }
   }
   return this.add(select);
 },