def each_row_batch_by_sql(sql, options={}, &block)
        options = {:connection => self.connection}.merge(options)
        cursor  = PostgreSQLCursor::Cursor.new(sql, options)
        return cursor.each_row_batch(&block) if block_given?
        cursor.iterate_batched
      end
Public: Yields each batch of up to block_size rows as an array of rows
where each row as a hash to the given block

Parameters: see each_row_by_sql

Example:
Post.each_row_batch_by_sql("select * from posts") do |batch|
Post.process_batch(batch)
end
Post.each_row_batch_by_sql("select * from posts").map do |batch|
Post.transform_batch(batch)
end

Returns the number of rows yielded to the block