lib/connection/result/chunk.js
function convertRowsetToRows(
    statement,
    startIndex,
    rowset,
    columns,
    mapColumnNameToIndices)
{
  // assert that rowset and columns are arrays
  Errors.assertInternal(Util.isArray(rowset));
  Errors.assertInternal(Util.isArray(columns));


  ///////////////////////////////////////////////////////////////////////////
  ////     Create functions that will be used as row methods             ////
  ///////////////////////////////////////////////////////////////////////////

  /**
   * Returns the index of this row in the result.
   *
   * @returns {Number}
   */
  var getRowIndex = function()
  {
    return this.rowIndex;
  };

  /**
   * Returns the statement that produced this row.
   *
   * @returns {*}
   */
  var getStatement = function getStatement()
  {
    return statement;
  };

  /**
   * Returns the value of a column.
   *
   * @param {String | Number} columnIdentifier this can be either the column
   *   name or the column index.
   *
   * @returns {*}
   */
  var getColumnValue = function getColumnValue(columnIdentifier)
  {
    // resolve the column identifier to the correct column if possible
    var column = resolveColumnIdentifierToColumn(
        columns, columnIdentifier, mapColumnNameToIndices);

    return column ? column.getRowValue(this) : undefined;
  };

  /**
   * Returns the value of a column as a String.
   *
   * @param {String | Number} columnIdentifier this can be either the column
   *   name or the column index.
   *
   * @returns {*}
   */
  var getColumnValueAsString = function getColumnValueAsString(columnIdentifier)
  {
    // resolve the column identifier to the correct column if possible
    var column = resolveColumnIdentifierToColumn(
        columns, columnIdentifier, mapColumnNameToIndices);

    return column ? column.getRowValueAsString(this) : undefined;
  };


  ///////////////////////////////////////////////////////////////////////////
  ////     Convert the rowset to an array of row objects                 ////
  ///////////////////////////////////////////////////////////////////////////

  // create a new array to store the processed rows
  var length = rowset.length;
  var rows = new Array(length);
  for (var index = 0; index < length; index++)
  {
    // add a new item to the rows array
    rows[index] =
    {
      _arrayProcessedColumns : [],

      values                 : rowset[index],
      rowIndex               : startIndex + index,
      getRowIndex            : getRowIndex,
      getStatement           : getStatement,
      getColumnValue         : getColumnValue,
      getColumnValueAsString : getColumnValueAsString
    };
  }

  return rows;
}
function convertRowsetToRows(
    statement,
    startIndex,
    rowset,
    columns,
    mapColumnNameToIndices)
{
  // assert that rowset and columns are arrays
  Errors.assertInternal(Util.isArray(rowset));
  Errors.assertInternal(Util.isArray(columns));


  ///////////////////////////////////////////////////////////////////////////
  ////     Create functions that will be used as row methods             ////
  ///////////////////////////////////////////////////////////////////////////

  /**
   * Returns the index of this row in the result.
   *
   * @returns {Number}
   */
  var getRowIndex = function()
  {
    return this.rowIndex;
  };

  /**
   * Returns the statement that produced this row.
   *
   * @returns {*}
   */
  var getStatement = function getStatement()
  {
    return statement;
  };

  /**
   * Returns the value of a column.
   *
   * @param {String | Number} columnIdentifier this can be either the column
   *   name or the column index.
   *
   * @returns {*}
   */
  var getColumnValue = function getColumnValue(columnIdentifier)
  {
    // resolve the column identifier to the correct column if possible
    var column = resolveColumnIdentifierToColumn(
        columns, columnIdentifier, mapColumnNameToIndices);

    return column ? column.getRowValue(this) : undefined;
  };

  /**
   * Returns the value of a column as a String.
   *
   * @param {String | Number} columnIdentifier this can be either the column
   *   name or the column index.
   *
   * @returns {*}
   */
  var getColumnValueAsString = function getColumnValueAsString(columnIdentifier)
  {
    // resolve the column identifier to the correct column if possible
    var column = resolveColumnIdentifierToColumn(
        columns, columnIdentifier, mapColumnNameToIndices);

    return column ? column.getRowValueAsString(this) : undefined;
  };


  ///////////////////////////////////////////////////////////////////////////
  ////     Convert the rowset to an array of row objects                 ////
  ///////////////////////////////////////////////////////////////////////////

  // create a new array to store the processed rows
  var length = rowset.length;
  var rows = new Array(length);
  for (var index = 0; index < length; index++)
  {
    // add a new item to the rows array
    rows[index] =
    {
      _arrayProcessedColumns : [],

      values                 : rowset[index],
      rowIndex               : startIndex + index,
      getRowIndex            : getRowIndex,
      getStatement           : getStatement,
      getColumnValue         : getColumnValue,
      getColumnValueAsString : getColumnValueAsString
    };
  }

  return rows;
}
function convertRowsetToRows ( statement , startIndex , rowset , columns , mapColumnNameToIndices ) { // assert that rowset and columns are arrays Errors . assertInternal ( Util . isArray ( rowset ) ) ; Errors . assertInternal ( Util . isArray ( columns ) ) ; /////////////////////////////////////////////////////////////////////////// ////     Create functions that will be used as row methods             //// /////////////////////////////////////////////////////////////////////////// /**
   * Returns the index of this row in the result.
   *
   * @returns {Number}
   */ var getRowIndex = function ( ) { return this . rowIndex ; } ; /**
   * Returns the statement that produced this row.
   *
   * @returns {*}
   */ var getStatement = function getStatement ( ) { return statement ; } ; /**
   * Returns the value of a column.
   *
   * @param {String | Number} columnIdentifier this can be either the column
   *   name or the column index.
   *
   * @returns {*}
   */ var getColumnValue = function getColumnValue ( columnIdentifier ) { // resolve the column identifier to the correct column if possible var column = resolveColumnIdentifierToColumn ( columns , columnIdentifier , mapColumnNameToIndices ) ; return column ? column . getRowValue ( this ) : undefined ; } ; /**
   * Returns the value of a column as a String.
   *
   * @param {String | Number} columnIdentifier this can be either the column
   *   name or the column index.
   *
   * @returns {*}
   */ var getColumnValueAsString = function getColumnValueAsString ( columnIdentifier ) { // resolve the column identifier to the correct column if possible var column = resolveColumnIdentifierToColumn ( columns , columnIdentifier , mapColumnNameToIndices ) ; return column ? column . getRowValueAsString ( this ) : undefined ; } ; /////////////////////////////////////////////////////////////////////////// ////     Convert the rowset to an array of row objects                 //// /////////////////////////////////////////////////////////////////////////// // create a new array to store the processed rows var length = rowset . length ; var rows = new Array ( length ) ; for ( var index = 0 ; index < length ; index ++ ) { // add a new item to the rows array rows [ index ] = { _arrayProcessedColumns : [ ] , values : rowset [ index ] , rowIndex : startIndex + index , getRowIndex : getRowIndex , getStatement : getStatement , getColumnValue : getColumnValue , getColumnValueAsString : getColumnValueAsString } ; } return rows ; }
Converts a rowset to an array of records.

@param statement
@param startIndex the chunk start index.
@param rowset
@param columns
@param mapColumnNameToIndices

@returns {Array}
@private
Converts a rowset to an array of records .