Dataset class for SQLite datasets that use the ruby-sqlite3 driver.
Execute the given type of statement with the hash of values.
# File lib/sequel/adapters/sqlite.rb, line 342 342: def call(type, bind_vars={}, *values, &block) 343: ps = to_prepared_statement(type, values) 344: ps.extend(BindArgumentMethods) 345: ps.call(bind_vars, &block) 346: end
Yield a hash for each row in the dataset.
# File lib/sequel/adapters/sqlite.rb, line 349 349: def fetch_rows(sql) 350: execute(sql) do |result| 351: i = 1 352: cps = db.conversion_procs 353: type_procs = result.types.map{|t| cps[base_type_name(t)]} 354: cols = result.columns.map{|c| i+=1; [output_identifier(c), i, type_procs[i]]} 355: @columns = cols.map{|c| c.first} 356: result.each do |values| 357: row = {} 358: cols.each do |name,i,type_proc| 359: v = values[i] 360: if type_proc && v 361: v = type_proc.call(v) 362: end 363: row[name] = v 364: end 365: yield row 366: end 367: end 368: end
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 373: def prepare(type, name=nil, *values) 374: ps = to_prepared_statement(type, values) 375: ps.extend(PreparedStatementMethods) 376: if name 377: ps.prepared_statement_name = name 378: db.set_prepared_statement(name, ps) 379: end 380: ps 381: end
The base type name for a given type, without any parenthetical part.
# File lib/sequel/adapters/sqlite.rb, line 386 386: def base_type_name(t) 387: (t =~ /^(.*?)\(/ ? $1 : t).downcase if t 388: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.