Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread
Message: 57707
BY: Joel VanderWerf (vjoel)
DATE: 2008-06-20 01:33
SUBJECT: type translation broken on some type names

 


This may be asking too much, but I was expecting type_translation to work with type names like FLOAT_DEGREES, not just FLOAT. Sqlite internally does recognize FLOAT_DEGREES (and in fact any string containing the 4 chars "FLOA") as a float type.

Here's an example:

require 'sqlite3'

db = SQLite3::Database.new("type-test.sqlite")
db.type_translation = true

db.execute " create table if not exists t1( latitude FLOAT ); "
db.execute " create table if not exists t2( latitude FLOAT_DEGREES ); "

db.execute " insert into t1 values ( 1.23 ) "
db.execute " insert into t2 values ( 1.23 ) "

p db.execute( " select * from t1 " ) #[1.23]]
p db.execute( " select * from t2 " ) #[["1.23"]]




Thread View

Thread Author Date
type translation broken on some type namesJoel VanderWerf2008-06-20 01:33

Post a followup to this message