index.js
function _attachEachRowMethod(qb) {
  /**
   * Create the eachRow function for a pass through to the datastax driver.
   *
   * @param `{Object} options` optional argument passed to datastax driver upon query execution
   * @param `{Function} rowCb` => function(row) {}
   * @param `{Function} errorCb` => function(err) {}
   * @returns {Client|exports|module.exports}
   */
  qb.eachRow = function (options, rowCb, errorCb) {

    // options is really rowCB
    if (_.isFunction(options)) {
      errorCb = rowCb;
      rowCb = options;
    }

    var _options = _.isObject(options) ? options : {};

    if (!_.isFunction(rowCb)) {
      rowCb = _.noop;
    }
    if (!_.isFunction(errorCb)) {
      errorCb = _.noop;
    }

    if (cassandra !== null && cassandra.connected) {
      var cql = qb.cql();
      cassandra.eachRow(cql, qb.bindings(), _options, rowCb, errorCb);
    }
    else {
      errorCb(new Error("Cassandra client is not initialized."));
    }

    // maintain chain
    return qb;
  };
}
function _attachEachRowMethod(qb) {
  /**
   * Create the eachRow function for a pass through to the datastax driver.
   *
   * @param `{Object} options` optional argument passed to datastax driver upon query execution
   * @param `{Function} rowCb` => function(row) {}
   * @param `{Function} errorCb` => function(err) {}
   * @returns {Client|exports|module.exports}
   */
  qb.eachRow = function (options, rowCb, errorCb) {

    // options is really rowCB
    if (_.isFunction(options)) {
      errorCb = rowCb;
      rowCb = options;
    }

    var _options = _.isObject(options) ? options : {};

    if (!_.isFunction(rowCb)) {
      rowCb = _.noop;
    }
    if (!_.isFunction(errorCb)) {
      errorCb = _.noop;
    }

    if (cassandra !== null && cassandra.connected) {
      var cql = qb.cql();
      cassandra.eachRow(cql, qb.bindings(), _options, rowCb, errorCb);
    }
    else {
      errorCb(new Error("Cassandra client is not initialized."));
    }

    // maintain chain
    return qb;
  };
}
function _attachEachRowMethod ( qb ) { /**
   * Create the eachRow function for a pass through to the datastax driver.
   *
   * @param `{Object} options` optional argument passed to datastax driver upon query execution
   * @param `{Function} rowCb` => function(row) {}
   * @param `{Function} errorCb` => function(err) {}
   * @returns {Client|exports|module.exports}
   */ qb . eachRow = function ( options , rowCb , errorCb ) { // options is really rowCB if ( _ . isFunction ( options ) ) { errorCb = rowCb ; rowCb = options ; } var _options = _ . isObject ( options ) ? options : { } ; if ( ! _ . isFunction ( rowCb ) ) { rowCb = _ . noop ; } if ( ! _ . isFunction ( errorCb ) ) { errorCb = _ . noop ; } if ( cassandra !== null && cassandra . connected ) { var cql = qb . cql ( ) ; cassandra . eachRow ( cql , qb . bindings ( ) , _options , rowCb , errorCb ) ; } else { errorCb ( new Error ( "Cassandra client is not initialized." ) ) ; } // maintain chain return qb ; } ; }
hooks the 'eachRow' cassandra client method to our query builder object
@param qb
@private
hooks the eachRow cassandra client method to our query builder object