Anyway I wanted to try accessing a MySQL database.
I didn't know what package to use :
- HDBC, HaSQL rely on ODBC for MySQL, which I don't like.
- HaskellDB doesn't let you write your own SQL queries, it relies on a higher level description of the database.
- MySQL-hs is discontinued
- And there's HSQL.
My home computer's OS is kubuntu feisty, and fortunately there's a package for HSQL available.
I gather some examples and try this simple file to begin :
module Main whereI try it with ghci and it gives me the following error :
import System.Environment (getArgs)
Loading package base ... linking ... done.Damn. I assume something is wrong with kubuntu's haskell package, so I uninstall it all, download a binary of the latest ghc ( 6.6.1 ), install it, then download HSQL ( 1.7 ), install it ( easy with cabal ).
db2.hs:6:7: parse error on input `Database.HSQL.mysql'
Failed, modules loaded: none.
I try again loading my little file with ghci and I get the exact same error message.
I hope someone on IRC will be able to help me.
Someone on IRC helped me. I had to use 'import Database.HSQL.MySQL'
I feel dumb now.