
Hey everyone, I'm figuring out how to do databases in Haskell (on OS X). So far, I've tried the following approaches: 1. hdbc. I'd like to connect to MySQL, so I need the ODBC backend. I couldn't get this to work under OS X, while I installed myodbc, which seems to be broken. 2. hsql. The packages on hackage don't compile, so I grabbed the darcs version. hqsl itself installed perfectly, but when I try to compile hsql-mysql, it does not recognize that hsql is already installed and tries to recompile. Compiling fails, so I generated a .tar.gz of hsql using cabal sdist, put it in the .cabal/packages directory in the right place, and finally, it does compile. Now hsql-mysql starts compiling, but it finally fails with: MySQL.hsc:270:0: error: ‘MYSQL_NO_DATA’ undeclared (first use in this function) MySQL.hsc:270:0: error: (Each undeclared identifier is reported only once MySQL.hsc:270:0: error: for each function it appears in.) So what is the state of hsql? And haskelldb? Are they actively maintained? Thanks, -chris

2008/7/4 Chris Eidhof
I'm figuring out how to do databases in Haskell (on OS X). So far, I've tried the following approaches:
1. hdbc. I'd like to connect to MySQL, so I need the ODBC backend. I couldn't get this to work under OS X, while I installed myodbc, which seems to be broken.
2. hsql. The packages on hackage don't compile, so I grabbed the darcs version.
Bummer, dude. The only database library that directly supports MySQL is HSQL. If you want to use another library, you'll have to get the ODBC MySQL backend working. Alistair

Hey Chris, I've been fiddling around with the database stuff myself and I had the same problems (on Linux). I eventually got both HaskellDB and HSQL to work, and am now using HSQL because HaskellDB had very poor documentation. I don't exactly know how I eventually got HSQL-MySQL to work, but I think it might be the case that you need to install a MySQL dev package first, as the haskell package only contains bindings to it. Good Luck, Paul P.S. It's nice to see I'm not the only one going into a Haskell frenzy after the exams. Chris Eidhof wrote:
Hey everyone,
I'm figuring out how to do databases in Haskell (on OS X). So far, I've tried the following approaches:
1. hdbc. I'd like to connect to MySQL, so I need the ODBC backend. I couldn't get this to work under OS X, while I installed myodbc, which seems to be broken.
2. hsql. The packages on hackage don't compile, so I grabbed the darcs version. hqsl itself installed perfectly, but when I try to compile hsql-mysql, it does not recognize that hsql is already installed and tries to recompile. Compiling fails, so I generated a .tar.gz of hsql using cabal sdist, put it in the .cabal/packages directory in the right place, and finally, it does compile. Now hsql-mysql starts compiling, but it finally fails with:
MySQL.hsc:270:0: error: ‘MYSQL_NO_DATA’ undeclared (first use in this function)
MySQL.hsc:270:0: error: (Each undeclared identifier is reported only once
MySQL.hsc:270:0: error: for each function it appears in.)
So what is the state of hsql? And haskelldb? Are they actively maintained?
Thanks, -chris_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Jul 4, 2008, at 7:54 AM, Chris Eidhof wrote:
1. hdbc. I'd like to connect to MySQL, so I need the ODBC backend. I couldn't get this to work under OS X, while I installed myodbc, which seems to be broken.
FWIW, I've had good luck with the SQLite3 bindings for HDBC on MacOS X. I had a bit of a hiccup with Linux, but that was only because the version of SQLite on the Linux box was a bit too old. (3.2.x versus 3.4.x on the MacOS box.) With 3.5.9 on the Linux box, everything worked swimmingly. I haven't tried the MySQL support, but I don't need it. The timestamps on the other packages were old enough (~2007 IIRC) that I didn't even try 'em. Depending on what your application is, you might get more mileage out of a binding to CouchDB or some other post-relational storage system. -- Paul

prb:
On Jul 4, 2008, at 7:54 AM, Chris Eidhof wrote:
1. hdbc. I'd like to connect to MySQL, so I need the ODBC backend. I couldn't get this to work under OS X, while I installed myodbc, which seems to be broken.
FWIW, I've had good luck with the SQLite3 bindings for HDBC on MacOS X. I had a bit of a hiccup with Linux, but that was only because the version of SQLite on the Linux box was a bit too old. (3.2.x versus 3.4.x on the MacOS box.) With 3.5.9 on the Linux box, everything worked swimmingly.
I haven't tried the MySQL support, but I don't need it.
The timestamps on the other packages were old enough (~2007 IIRC) that I didn't even try 'em.
Depending on what your application is, you might get more mileage out of a binding to CouchDB or some other post-relational storage system.
The YHC guys have a simple CouchDB binding too. I was thinking this might be a nice project to actually polish up into a comprehensive system. -- Don
participants (5)
-
Alistair Bayley
-
Chris Eidhof
-
Don Stewart
-
Paul Brown
-
Paul Visschers