lib/formatter.js
function outputQuery(compiled, isParameter) {
    var sql = compiled.sql || '';
    if (sql) {
      if (compiled.method === 'select' && (isParameter || compiled.as)) {
        sql = '(' + sql + ')';
        if (compiled.as) {
          return this.alias(sql, this.wrap(compiled.as));
        }
      }
    }
    return sql;
  }
function outputQuery(compiled, isParameter) {
    var sql = compiled.sql || '';
    if (sql) {
      if (compiled.method === 'select' && (isParameter || compiled.as)) {
        sql = '(' + sql + ')';
        if (compiled.as) {
          return this.alias(sql, this.wrap(compiled.as));
        }
      }
    }
    return sql;
  }
function outputQuery ( compiled , isParameter ) { var sql = compiled . sql || '' ; if ( sql ) { if ( compiled . method === 'select' && ( isParameter || compiled . as ) ) { sql = '(' + sql + ')' ; if ( compiled . as ) { return this . alias ( sql , this . wrap ( compiled . as ) ) ; } } } return sql ; }
Ensures the query is aliased if necessary.
Ensures the query is aliased if necessary .