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

call fetch_rows prepare

### Included Modules

::Sequel::SQLite::DatasetMethods

### Classes and Modules

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

### Constants

PREPARED_ARG_PLACEHOLDER | = | ':'.freeze

### Public Instance methods

call(type, bind_vars={}, *values, &block)

Execute the given type of statement with the hash of values.

[Source]

         # File lib/sequel/adapters/sqlite.rb, line 264
    264:       def call(type, bind_vars={}, *values, &block)
    265:         ps = to_prepared_statement(type, values)
    266:         ps.extend(BindArgumentMethods)
    267:         ps.call(bind_vars, &block)
    268:       end

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

Yield a hash for each row in the dataset.

[Source]

         # File lib/sequel/adapters/sqlite.rb, line 271
    271:       def fetch_rows(sql)
    272:         execute(sql) do |result|
    273:           i = -1
    274:           cols = result.columns.map{|c| [output_identifier(c), i+=1]}
    275:           @columns = cols.map{|c| c.first}
    276:           result.each do |values|
    277:             row = {}
    278:             cols.each{|n,i| row[n] = values[i]}
    279:             yield row
    280:           end
    281:         end
    282:       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 287
    287:       def prepare(type, name=nil, *values)
    288:         ps = to_prepared_statement(type, values)
    289:         ps.extend(PreparedStatementMethods)
    290:         if name
    291:           ps.prepared_statement_name = name
    292:           db.prepared_statements[name] = ps
    293:         end
    294:         ps.prepared_sql
    295:         ps
    296:       end

[Validate]