class Sequel::Firebird::Dataset

  1. lib/sequel/adapters/firebird.rb
Parent: Firebird

Dataset class for Firebird datasets

Methods

Public Instance

  1. fetch_rows

Constants

DatasetClass = self  

Public Instance methods

fetch_rows (sql)

Yield all rows returned by executing the given SQL and converting the types.

[show source]
# File lib/sequel/adapters/firebird.rb, line 87
def fetch_rows(sql)
  execute(sql) do |s|
    begin
      @columns = columns = s.fields.map{|c| output_identifier(c.name)}
      s.fetchall.each do |r|
        h = {}
        r.zip(columns).each{|v, c| h[c] = v}
        yield h
      end
    ensure
      s.close
    end
  end
  self
end