lib/dialects/oracle/query.js
/**
   * High level function that handles the results of a query execution.
   *
   *
   * Example:
   *  query.formatResults([
   *    {
   *      id: 1,              // this is from the main table
   *      attr2: 'snafu',     // this is from the main table
   *      Tasks.id: 1,        // this is from the associated table
   *      Tasks.title: 'task' // this is from the associated table
   *    }
   *  ])
   *
   * @param {Array} data - The result of the query execution.
   * @private
   */
High level function that handles the results of a query execution.

@param {Array} data - The result of the query execution.
@private
High level function that handles the results of a query execution . @param { Array } data - The result of the query execution . @private
formatResults(data) {
    var result = this.instance;
    ;
    if (this.isInsertQuery(data)) {
      result = this.handleInsertQuery(data);
    } else if (this.isSelectQuery()) {
      result = this.handleSelectQuery(data.rows);
    } else if (this.isShowTablesQuery()) {
      result = this.handleShowTablesQuery(data.rows);
       else if (this.isDescribeQuery()) {
      ;
      );
       else if (this.isShowIndexesQuery()) {
       else if (this.isCallQuery()) {
       else if (this.isBulkUpdateQuery() || this.isBulkDeleteQuery() || this.isUpsertQuery()) {
    } else if (this.isBulkDeleteQuery() || this.isDeleteQuery()) {
      result = this.handleDeleteQuery(data);
    } else if (this.isUpdateQuery()) {
      result = this.handleUpdateQuery(data);
    } else if (this.isBulkUpdateQuery()) {
      result = this.handleBulkUpdateQuery(data);
    } else if (this.isVersionQuery()) {
      var drows = data.rows;
      var endRows = drows.length;
      for (var i = 0; i < endRows; i++) {
        if (drows[ i ].PRODUCT.indexOf('Database') >= 0) {
          result = 'PRODUCT=' + drows[ i ].PRODUCT + ', VERSION=' + drows[ i ].VERSION + ', STATUS=' + drows[ i ].STATUS;
        }
      }
       else if (this.isForeignKeysQuery()) {
    } else if (this.isRawQuery()) {
      result = [ data.rows, data ];
    }
    return result;
  }
formatResults ( data ) { var result = this . instance ; if ( this . isInsertQuery ( data ) ) { result = this . handleInsertQuery ( data ) ; } else if ( this . isSelectQuery ( ) ) { result = this . handleSelectQuery ( data . rows ) ; } else if ( this . isShowTablesQuery ( ) ) { result = this . handleShowTablesQuery ( data . rows ) ; } else if ( this . isBulkDeleteQuery ( ) || this . isDeleteQuery ( ) ) { result = this . handleDeleteQuery ( data ) ; } else if ( this . isUpdateQuery ( ) ) { result = this . handleUpdateQuery ( data ) ; } else if ( this . isBulkUpdateQuery ( ) ) { result = this . handleBulkUpdateQuery ( data ) ; } else if ( this . isVersionQuery ( ) ) { var drows = data . rows ; var endRows = drows . length ; for ( var i = 0 ; i < endRows ; i ++ ) { if ( drows [ i ] . PRODUCT . indexOf ( 'Database' ) >= 0 ) { result = 'PRODUCT=' + drows [ i ] . PRODUCT + ', VERSION=' + drows [ i ] . VERSION + ', STATUS=' + drows [ i ] . STATUS ; } } } else if ( this . isRawQuery ( ) ) { result = [ data . rows , data ] ; } return result ; }
High level function that handles the results of a query execution.
High level function that handles the results of a query execution .
// if (data && typeof data.rows === 'object' && typeof data.metaData === 'object' ) { //   var rows=[], drows=data.rows, dmeta=data.metaData //   var endRows=drows.length; //   var endMeta=dmeta.length; //   for (var i = 0; i < endRows; i++){ //     var obj={} //     for(var j = 0 ; j < endMeta; j++){ //        obj[dmeta[j].name]=drows[i][j]; //     } //     rows.push(obj); //   } //   data={ //     metaData: data.metaData, //     outBinds: data.outBinds, //     rows: rows, //     rowsAffected: data.rowsAffected //   }; // } // } else if (this.isDescribeQuery()) { //   result = {}; //   data.forEach(function(_result) { //     result[_result.Field] = { //       type: _result.Type.toUpperCase(), //       allowNull: (_result.Null === 'YES'), //       defaultValue: _result.Default //     }; //   }); // } else if (this.isShowIndexesQuery()) { //   result = this.handleShowIndexesQuery(data); // } else if (this.isCallQuery()) { //   result = data[0]; // } else if (this.isBulkUpdateQuery() || this.isBulkDeleteQuery() || this.isUpsertQuery()) { //   result = data.affectedRows; // } else if (this.isForeignKeysQuery()) { //   result = data; // MySQL returns row data and metadata (affected rows etc) in a single object - let's standarize it, sorta