Start with a table with one data type as string (using sqlite command line 3.6.10 or better)
sqlite> create table test (id integer, name string)
sqlite> insert into test values (1, "Jay")
sqlite> insert into test values (2, "May")
From the ruby programming interface,
irb(main):036:0> db.execute("select * from test") do |row|
irb(main):037:1* puts row.to_s
irb(main):038:1> end
Amalgalite::Error: Unable to convert SQL type of string to a Ruby class
from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/type_maps/default_map.rb:99:in result_value_of' from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/statement.rb:291:innext_row'
from (irb):38:in each_with_index' from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/statement.rb:261:ineach'
from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/statement.rb:261:in each_with_index' from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/statement.rb:261:innext_row'
from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/statement.rb:247:in each' from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/database.rb:292:inexecute'
from (irb):36
from :0
irb(main):039:0>
The software defect seems to be in line lib/amalgalite/type_maps/default_map.rb on line 27
'string' => %w[ text char varchar character ],
Line 27 should include 'string' in the list as well and probably say
'string' => %w[ string text char varchar character ],
Although I didn't test it there is probably also a bug in line 25, which says
'float' => %w[ double real numeric decimal ],
Line 25 should include "float" in the list and it should probably say,
'float' => %w[ float double real numeric decimal ],
Start with a table with one data type as string (using sqlite command line 3.6.10 or better)
sqlite> create table test (id integer, name string) sqlite> insert into test values (1, "Jay") sqlite> insert into test values (2, "May")
From the ruby programming interface,
irb(main):036:0> db.execute("select * from test") do |row| irb(main):037:1* puts row.to_s irb(main):038:1> end Amalgalite::Error: Unable to convert SQL type of string to a Ruby class from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/type_maps/default_map.rb:99:in
result_value_of' from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/statement.rb:291:in
next_row' from (irb):38:ineach_with_index' from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/statement.rb:261:in
each' from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/statement.rb:261:ineach_with_index' from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/statement.rb:261:in
next_row' from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/statement.rb:247:ineach' from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/database.rb:292:in
execute' from (irb):36 from :0 irb(main):039:0>The software defect seems to be in line lib/amalgalite/type_maps/default_map.rb on line 27
'string' => %w[ text char varchar character ],
Line 27 should include 'string' in the list as well and probably say
'string' => %w[ string text char varchar character ],
Although I didn't test it there is probably also a bug in line 25, which says
'float' => %w[ double real numeric decimal ],
Line 25 should include "float" in the list and it should probably say,
'float' => %w[ float double real numeric decimal ],