Class Sequel::Amalgalite::Dataset
In: lib/sequel/adapters/amalgalite.rb
Parent: Sequel::Dataset

Dataset class for SQLite datasets that use the amalgalite driver.

Methods

Included Modules

::Sequel::SQLite::DatasetMethods

Constants

EXPLAIN = 'EXPLAIN %s'.freeze

Public Instance methods

Return an array of strings specifying a query explanation for the current dataset.

[Source]

     # File lib/sequel/adapters/amalgalite.rb, line 165
165:       def explain
166:         res = []
167:         @db.result_set(EXPLAIN % select_sql(opts), nil) {|r| res << r}
168:         res
169:       end

Yield a hash for each row in the dataset.

[Source]

     # File lib/sequel/adapters/amalgalite.rb, line 172
172:       def fetch_rows(sql)
173:         execute(sql) do |stmt|
174:           stmt.result_meta
175:           @columns = cols = stmt.result_fields.map{|c| output_identifier(c)}
176:           col_count = cols.size
177:           stmt.each do |result|
178:             row = {}
179:             col_count.times{|i| row[cols[i]] = result[i]}
180:             yield row
181:           end
182:         end
183:       end

[Validate]