On May 31, 4:03 am, Stefan <[email protected]> wrote: > Hi, > > I am writing a test of a class and I am using in-memory sqlite. I am > trying to do: > > statement = "SELECT ...constructed expressions... FROM ..." > > where constructed expressions contain more various aggregations, > including simple: "COUNT(*) AS record_count" > > when I do: > > values = database[statement].first > > then values[:record_count] is of class String, not any of the numeric > type. > > How can I get results in appropriate class? Such as Integer for > integer types or Float for types with floating point. It works for > Postgres, but for sqlite all results seem to be Strings.
I don't believe sqlite3 specifies the type of constructed expressions, so they default to using strings, as that is how ruby-sqlite3 returns them. Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
