[Haskell-cafe] HDBC and Sqlite3: SqlValue is restricted to SqlString

Malte Milatz malte at gmx-topmail.de
Wed Jun 27 13:26:45 EDT 2007


It's always good to know there's a general Haskell mailing list to ask
questions.  I'm experimenting with the HDBC package in combination with
Sqlite3. 

Here's my example table:

	sqlite> .schema foos
	CREATE TABLE foos (id integer primary key, flag bool,
	comment text);

	sqlite> select * from foos;
	id          flag        comment   
	----------  ----------  ----------
	1           0           a         
	2           1           b         

Here's my query in ghci:

	Database.HDBC> quickQuery conn "select * from foos;" []
	[[SqlString "1",SqlString "0",SqlString "a"],
	[SqlString "2",SqlString "1",SqlString "b"]]

What strikes me is that all values are represented as SqlStrings,
although the type SqlValue would allow something more succint, e.g.
SqlBool for the flag column.  Is this a general limitation of the Sqlite
backend, or is this by design (Sqlite seems to do typing differently
than I had expected), or is it just that nobody has implemented a better
behavior yet?

Curiously, Malte



More information about the Haskell-Cafe mailing list