Methods

Class/Module Index [+]

Quicksearch

Sequel::Mysql2::Dataset

Dataset class for MySQL datasets accessed via the native driver.

Constants

DatasetClass

Public Instance Methods

fetch_rows(sql) click to toggle source

Yield all rows matching this dataset.

# File lib/sequel/adapters/mysql2.rb, line 147
def fetch_rows(sql)
  execute(sql) do |r|
    if identifier_output_method
      cols = r.fields
      @columns = cols2 = cols.map{|c| output_identifier(c.to_s)}
      cs = cols.zip(cols2)
      r.each do |row|
        h = {}
        cs.each do |a, b|
          h[b] = row[a]
        end
        yield h
      end
    else
      @columns = r.fields
      r.each{|h| yield h}
    end
  end
  self
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.