Class: Sequel::SQLite::Dataset

Class | Sequel::SQLite::Dataset
In: | lib/sequel/adapters/sqlite.rb
Parent: | Sequel::Dataset

Dataset class for SQLite datasets that use the ruby-sqlite3 driver.

### Methods

fetch_rows prepare

### Included Modules

::Sequel::SQLite::DatasetMethods

### Classes and Modules

Module Sequel::SQLite::Dataset::ArgumentMapper
Module Sequel::SQLite::Dataset::PreparedStatementMethods

### Constants

PREPARED_ARG_PLACEHOLDER | = | ':'.freeze

### Public Instance methods

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

Yield a hash for each row in the dataset.

[Source]

         # File lib/sequel/adapters/sqlite.rb, line 175
    175:       def fetch_rows(sql)
    176:         execute(sql) do |result|
    177:           i = -1
    178:           cols = result.columns.map{|c| [output_identifier(c), i+=1]}
    179:           @columns = cols.map{|c| c.first}
    180:           result.each do |values|
    181:             row = {}
    182:             cols.each{|n,i| row[n] = values[i]}
    183:             yield row
    184:           end
    185:         end
    186:       end

prepare(type, name=nil, *values)

Prepare the given type of query with the given name and store it in the database. Note that a new native prepared statement is created on each call to this prepared statement.

[Source]

         # File lib/sequel/adapters/sqlite.rb, line 191
    191:       def prepare(type, name=nil, *values)
    192:         ps = to_prepared_statement(type, values)
    193:         ps.extend(PreparedStatementMethods)
    194:         db.prepared_statements[name] = ps if name
    195:         ps
    196:       end

[Validate]