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

Dataset class for SQLite datasets that use the amalgalite driver.

### Methods

explain fetch_rows

### Included Modules

::Sequel::SQLite::DatasetMethods

### Constants

EXPLAIN | = | 'EXPLAIN %s'.freeze

### Public Instance methods

explain()

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

[Source]

         # File lib/sequel/adapters/amalgalite.rb, line 180
    180:       def explain
    181:         res = []
    182:         @db.result_set(EXPLAIN % select_sql(opts), nil) {|r| res << r}
    183:         res
    184:       end

fetch_rows(sql) {|row| ...}

Yield a hash for each row in the dataset.

[Source]

         # File lib/sequel/adapters/amalgalite.rb, line 187
    187:       def fetch_rows(sql)
    188:         execute(sql) do |stmt|
    189:           stmt.result_meta
    190:           @columns = cols = stmt.result_fields.map{|c| output_identifier(c)}
    191:           col_count = cols.size
    192:           stmt.each do |result|
    193:             row = {}
    194:             col_count.times{|i| row[cols[i]] = result[i]}
    195:             yield row
    196:           end
    197:         end
    198:       end

[Validate]