I'm trying to use Haskell for a database app, and, as usual for Haskell, I'm finding the lack of decent documentation a real pain.
HaskellDB looks like a nice, high level approach to using databases, and, despite the look of its main page, the project isn't dead. However, when running the tests, I get this:
Problem with FlatDB: user error (Couldn't load Database.HaskellDB.FlatDB.driver from package askelldb-flat-0.10) Skipping FlatDB Problem with HSQL MySQL: user error (Couldn't load Database.HaskellDB.HSQL.MySQL.driver from package haskelldb-hsql-mysql-0.10) Skipping HSQL MySQL Problem with HSQL SQLite: user error (Couldn't load Database.HaskellDB.HSQL.SQLite.driver from package haskelldb-hsql-sqlite-0.10) Skipping HSQL SQLite Cases: 0 Tried: 0 Errors: 0 Failures: 0 Skipped databases: ["FlatDB","HSQL MySQL","HSQL SQLite"]
This is despite having followed the build instructions carefully. I don't even know if I'm doing the right thing with these tests — they obviously require some configuration, which I think I've done right, but there is no README for running the tests. I've googled for the error, with no results (next step the mailing list, but it seems crazy that I can't even get this far without subscribing to a mailing list and bothering someone). Also, the test suite doesn't actually compile without a minor fix, which indicates that not many people are actively running these tests, so maybe this entire test suite is non-functional. Who knows?
So, I'll see if I can just use HSQL straight. Unfortunately, there is no real documentation or tutorial for HSQL, nothing in the sources that tells you how to do even a basic test — the online tutorials are very old and don't seem to actually cover making a connection. I tried this as a test app:
import Database.HSQL.MySQL (connect) import Database.HSQL main = do c <- connect "localhost" "my_db" "my_username" "my_password" disconnect c return ()
It compiles, but throws this extremely helpful exception:
So, I'm giving up for now. HaskellDB also appears to have an HDBC backend (HDBC being another lower level SQL library, like HSQL), so I'll try HDBC when I get the motivation. I want to know that I have libraries that basically work before I invest any time on this, and tests or basic examples are essential to finding this out. Unfortunately these things seem to be somewhat lacking.