# File lib/sequel/adapters/sqlite.rb, line 319 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]]} self.columns = cols.map(&: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
The base type name for a given type, without any parenthetical part.
# File lib/sequel/adapters/sqlite.rb, line 343 def base_type_name(t) (t =~ /^(.*?)\(/ ? $1 : t).downcase if t end
# File lib/sequel/adapters/sqlite.rb, line 352 def bound_variable_modules [BindArgumentMethods] end
Quote the string using the adapter class method.
# File lib/sequel/adapters/sqlite.rb, line 348 def literal_string_append(sql, v) sql << "'" << ::SQLite3::Database.quote(v) << "'" end
SQLite uses a : before the name of the argument as a placeholder.
# File lib/sequel/adapters/sqlite.rb, line 361 def prepared_arg_placeholder ':' end
# File lib/sequel/adapters/sqlite.rb, line 356 def prepared_statement_modules [PreparedStatementMethods] end