[Haskell-cafe] HDBC and Sqlite3: SqlValue is restricted to
malte at gmx-topmail.de
Thu Jun 28 04:02:10 EDT 2007
Michael T. Richter:
> Short summary: any data you put into SQLite3 may or may not come out
> as text. :D
Thanks, Michael. (I'm forwarding this to the list again because there is
at least one other person interested.)
Well, I've read that page before and I think you're wrong. Sqlite3 is
“spontaneously typed”, so to say, but it is still typed. Furthermore
the column type gives a hint at how to interpret a value. And what's
more, Sqlite3 does not store integers as plain strings anymore, so it
seems very unnatural to me for a binding to represent them as strings.
Although I do not use Python, I made use of the fact that there are a
couple of Python libraries installed on my system, and voilà:
>>> print cur.fetchall()
[(1, 0, u'a'), (2, 1, u'b')]
Here I get my integers as integers and my strings as strings. And,
well, Boolean values as numbers, but that's Python's truth philosophy.
Anyway, this has convinced me that there is room for improvement in
HDBC-Sqlite, unless I have entirely missed something.
More information about the Haskell-Cafe