class Sequel::DataObjects::Dataset
Dataset class for Sequel::DataObjects::Database objects.
Public Instance Methods
fetch_rows(sql) { |h| ... }
click to toggle source
Execute the SQL on the database and yield the rows as hashes with symbol keys.
# File lib/sequel/adapters/do.rb, line 147 def fetch_rows(sql) execute(sql) do |reader| cols = self.columns = reader.fields.map{|f| output_identifier(f)} while(reader.next!) do h = {} cols.zip(reader.values).each{|k, v| h[k] = v} yield h end end self end