[Haskell-cafe] Trivial database access in Haskell

Kirsten Chevalier catamorphism at gmail.com
Mon Dec 11 17:14:45 EST 2006

On 12/11/06, Paul Moore <p.f.moore at gmail.com> wrote:
> I've looked at the various database access libraries for Haskell, but
> they all seem to be missing a couple of key pieces if I want to use
> them:
> 1. Simple documentation of how to install the library (starting from a
> vanilla GHC installation on Windows, plus Oracle software, to the
> point where I can use the library in my code). All I need is Oracle
> access, so other database client libraries can be ignored. I'd rather
> not use ODBC, but will if required.
> 2. Simple examples on how to actually run a query. For example, how do
> I code the follwing SQL*Plus code (should be pretty self-explanatory)
> in Haskell:
>     connect scott/tiger at mydb
>     select * from emp;
> (Connect to the database "mydb" as user "scott", password "tiger", and
> issue the query "select * from emp"). Ideally, I'd like the Haskell
> code to not be *too* much more verbose than this (although I can
> accept that Haskell, beng a general language, won't be able to be
> quite as concise as a special tool can manage).
> Without this basis, I don't really have a way to evaluate the various
> libraries available...

This is when you write that documentation :-) And I say that without
knowing anything about any of the Haskell database libraries -- I just
suspect that if you can't find any good documentation for them, that's
your cue to write it.

This might not seem like a helpful answer, but often it's the best
answer anyone can give. I realize that you only have so many hours in
the day, but only a few people get paid to work on Haskell full-time.
So if you really wanted to find out whether the existing libraries
would work for your purposes, try it, and write up what you found so
that other people can benefit from it.


Kirsten Chevalier* chevalier at alum.wellesley.edu *Often in error, never in doubt
"We used to say that our love was like hemp rope / Three times as strong as the
rope that you buy domestically." -- Dar Williams

More information about the Haskell-Cafe mailing list