lib/dataset/actions.js
function (block, cb) {
            var rowCb, ret;
            if (this.__opts.graph) {
                ret = this.graphEach(block);
            } else {
                ret = this.fetchRows(this.selectSql);
                if ((rowCb = this.rowCb)) {
                    ret = ret.map(function (r) {
                        return rowCb(r);
                    });
                }
                if (block) {
                    ret = ret.forEach(block);
                }
            }
            return ret.classic(cb);
        }
function (block, cb) {
            var rowCb, ret;
            if (this.__opts.graph) {
                ret = this.graphEach(block);
            } else {
                ret = this.fetchRows(this.selectSql);
                if ((rowCb = this.rowCb)) {
                    ret = ret.map(function (r) {
                        return rowCb(r);
                    });
                }
                if (block) {
                    ret = ret.forEach(block);
                }
            }
            return ret.classic(cb);
        }
function ( block , cb ) { var rowCb , ret ; if ( this . __opts . graph ) { ret = this . graphEach ( block ) ; } else { ret = this . fetchRows ( this . selectSql ) ; if ( ( rowCb = this . rowCb ) ) { ret = ret . map ( function ( r ) { return rowCb ( r ) ; } ) ; } if ( block ) { ret = ret . forEach ( block ) ; } } return ret . classic ( cb ) ; }
Iterates over the records in the dataset as they are returned from the
database adapter.

@example

// SELECT * FROM table
DB.from("table").forEach(function(row){
//....do something
});

@param {Function} [block] the block to invoke for each row.
@param {Function} [cb] the callback to invoke when the action is done.

@return {comb.Promise} a promise that is resolved when the action has completed.
Iterates over the records in the dataset as they are returned from the database adapter .