
Ok, let me ask it in another way. Is there a good way to access databases, mysql in particular, from haskell program?
On Sun, 16 Aug 2009 18:54:32 +0400 "AK" == Alexander Kotelnikov
wrote: AK> AK> Hi AK> I wanted to see what access to databases HSQL provides and I stumbled in AK> the very beginning. Assume I have a table map1 with attributes "i" and "s" AK> interger and varchar() respectively. The following code fails (with AK> segfault) for me. And I see no other way to tell compiler that I am AK> expecting an interger to be found as 'i' in a fetched row. AK> AK> import Database.HSQL AK> import Database.HSQL.MySQL AK> AK> main :: IO () AK> main = do AK> c <- connect "localhost" "tx_test" "sacha" "" AK> s <- query c "SELECT i FROM map1" AK> print $ getFieldsTypes s AK> i <- (getFieldValue s "i")::IO Int AK> print i AK> disconnect c AK> AK> -- AK> Alexander Kotelnikov AK> Saint-Petersburg, Russia AK> -- Alexander Kotelnikov Saint-Petersburg, Russia