sure, your program could use a database with HDBC. But I'll guess
(since you love static typing so much) you dislike formulating queries
in strings and to check the positions of your ?-placeholders and to
convert your values with fromSql/toSql. Maybe you would prefer
for your select query a list of tuples instead of a list of lists,
because your beloved pattern matching needs always a dummy case.
And here  is hesql... it's a preprocessor, which rewrites SQL-Queries
as haskell functions. You put all your SQL-Queries
verifyLogin login' password' =
select1' Accountid, Login, RealName, Email from Account
where (password is null or password = md5(password')) and Lower(Login) = login'
and not Locked;
in a module (example/Account.hesql) and run
$ hesql example/Account.hesql dbname=example
which will write example/Account.hs, the real haskell module.
It will generate code for a haskell function with the type:
Christoph> Hello, sure, your program could use a database with
Christoph> HDBC. But I'll guess (since you love static typing so
Christoph> much) you dislike formulating queries in strings and to
Christoph> check the positions of your ?-placeholders and to
Christoph> convert your values with fromSql/toSql.
I've been working on a SQL parser
(http://hackage.haskell.org/package/hssqlppp) which might be useful
for your project, although it might be a bit heavy weight (its feature
scope getting more and more out of control...). Adding support for
parsing ? placeholder statements is on my todo list, I could bump it
up to the top if that would be useful to you.
2009/11/13 Colin Paul Adams <[hidden email]>:
> Why would hesql be an improvement for me? It sounds like several steps backwards?
The last few paragraphs on this page
http://lindstroem.wordpress.com/2008/09/18/metahdbc-paper-draft/ (comment dated November 4, 2008 at 9:31 pm, starting with 'Second,
MetaHDBC is a thin layer above a DBMS, as compared to ...') give some
reasons why an approach like this might sometimes be preferred to a
haskelldb-like approach, different situations can recommend one or the