__reduceCommandsToQuery__(commandArray, includeColumns) {

    let lastAggregate = null;

    return commandArray.reduce((prev, command, i) => {

      if (command.aggregate.length && command.groupBy.length) {
        lastAggregate = command.aggregate;
      }

      let table = `t${i}`;

      let multiFilter = this.db.adapter.createMultiFilter(table, command.where ? command.where.comparisons : []);
      let params = this.db.adapter.getParamsFromMultiFilter(multiFilter);

      let joins = null;
      let columns = includeColumns || lastAggregate || this.Model.columnNames();

      columns = columns
        .map(c => typeof c !== 'string' ? c : {columnNames: [c], alias: c, transformation: v => v})
        .map(c => Object.keys(c).reduce((p, k) => { return (p[k] = c[k], p); }, {}));

      !command.groupBy.length && columns.forEach(c => {
        c.transformation = v => v;
        c.columnNames = [c.alias];
      });

      return {
        sql: this.db.adapter.generateSelectQuery(
          prev.sql || {table: this.Model.table()},
          table,
          columns,
          multiFilter,
          joins,
          command.groupBy,
          command.orderBy,
          command.limit,
          prev.params.length
        ),
        params: prev.params.concat(params)
      }

    }, {sql: null, params: []});

  }
Reduces an array of commands from query informtion to a SQL query
@param {Array} [commandArray]
@param {Array} [includeColumns=*] Which columns to include, includes all by default
@return {Object} Looks like {sql: [], params: []}
@private