class Sequel::SQLite::Dataset

Constants

BindArgumentMethods
PreparedStatementMethods

Public Instance Methods

fetch_rows(sql) { |row| ... } click to toggle source
    # File lib/sequel/adapters/sqlite.rb
324 def fetch_rows(sql)
325   execute(sql) do |result|
326     cps = db.conversion_procs
327     type_procs = result.types.map{|t| cps[base_type_name(t)]}
328     j = -1
329     cols = result.columns.map{|c| [output_identifier(c), type_procs[(j+=1)]]}
330     self.columns = cols.map(&:first)
331     max = cols.length
332     result.each do |values|
333       row = {}
334       i = -1
335       while (i += 1) < max
336         name, type_proc = cols[i]
337         v = values[i]
338         if type_proc && v
339           v = type_proc.call(v)
340         end
341         row[name] = v
342       end
343       yield row
344     end
345   end
346 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
351 def base_type_name(t)
352   (t =~ /^(.*?)\(/ ? $1 : t).downcase if t
353 end
bound_variable_modules() click to toggle source
    # File lib/sequel/adapters/sqlite.rb
360 def bound_variable_modules
361   [BindArgumentMethods]
362 end
literal_string_append(sql, v) click to toggle source

Quote the string using the adapter class method.

    # File lib/sequel/adapters/sqlite.rb
356 def literal_string_append(sql, v)
357   sql << "'" << ::SQLite3::Database.quote(v) << "'"
358 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
369 def prepared_arg_placeholder
370   ':'
371 end
prepared_statement_modules() click to toggle source
    # File lib/sequel/adapters/sqlite.rb
364 def prepared_statement_modules
365   [PreparedStatementMethods]
366 end