class Sequel::SQLite::Dataset

Constants

BindArgumentMethods
PreparedStatementMethods

Public Instance Methods

fetch_rows(sql) { |row| ... } click to toggle source
    # File lib/sequel/adapters/sqlite.rb
326 def fetch_rows(sql)
327   execute(sql) do |result|
328     cps = db.conversion_procs
329     type_procs = result.types.map{|t| cps[base_type_name(t)]}
330     j = -1
331     cols = result.columns.map{|c| [output_identifier(c), type_procs[(j+=1)]]}
332     self.columns = cols.map(&:first)
333     max = cols.length
334     result.each do |values|
335       row = {}
336       i = -1
337       while (i += 1) < max
338         name, type_proc = cols[i]
339         v = values[i]
340         if type_proc && v
341           v = type_proc.call(v)
342         end
343         row[name] = v
344       end
345       yield row
346     end
347   end
348 end

Private Instance Methods

base_type_name(t) click to toggle source

The base type name for a given type, without any parenthetical part.

    # File lib/sequel/adapters/sqlite.rb
353 def base_type_name(t)
354   (t =~ /^(.*?)\(/ ? $1 : t).downcase if t
355 end
bound_variable_modules() click to toggle source
    # File lib/sequel/adapters/sqlite.rb
362 def bound_variable_modules
363   [BindArgumentMethods]
364 end
literal_string_append(sql, v) click to toggle source

Quote the string using the adapter class method.

    # File lib/sequel/adapters/sqlite.rb
358 def literal_string_append(sql, v)
359   sql << "'" << ::SQLite3::Database.quote(v) << "'"
360 end
prepared_arg_placeholder() click to toggle source

SQLite uses a : before the name of the argument as a placeholder.

    # File lib/sequel/adapters/sqlite.rb
371 def prepared_arg_placeholder
372   ':'
373 end
prepared_statement_modules() click to toggle source
    # File lib/sequel/adapters/sqlite.rb
366 def prepared_statement_modules
367   [PreparedStatementMethods]
368 end