Class/Module Index [+]

Quicksearch

Sequel::SQLite::Dataset

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

Public Instance Methods

call(type, bind_vars={}, *values, &block) click to toggle source

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

# File lib/sequel/adapters/sqlite.rb, line 342
def call(type, bind_vars={}, *values, &block)
  ps = to_prepared_statement(type, values)
  ps.extend(BindArgumentMethods)
  ps.call(bind_vars, &block)
end
fetch_rows(sql) click to toggle source

Yield a hash for each row in the dataset.

# File lib/sequel/adapters/sqlite.rb, line 349
def fetch_rows(sql)
  execute(sql) do |result|
    i = -1
    cps = db.conversion_procs
    type_procs = result.types.map{|t| cps[base_type_name(t)]}
    cols = result.columns.map{|c| i+=1; [output_identifier(c), i, type_procs[i]]}
    @columns = cols.map{|c| c.first}
    result.each do |values|
      row = {}
      cols.each do |name,id,type_proc|
        v = values[id]
        if type_proc && v
          v = type_proc.call(v)
        end
        row[name] = v
      end
      yield row
    end
  end
end
prepare(type, name=nil, *values) click to toggle source

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.

# File lib/sequel/adapters/sqlite.rb, line 373
def prepare(type, name=nil, *values)
  ps = to_prepared_statement(type, values)
  ps.extend(PreparedStatementMethods)
  if name
    ps.prepared_statement_name = name
    db.set_prepared_statement(name, ps)
  end
  ps
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.