[Haskell-cafe] Re: HDBC or HSQL

John Goerzen jgoerzen at complete.org
Sun Jul 29 19:04:06 EDT 2007

On 2007-07-25, George Moschovitis <george.moschovitis at gmail.com> wrote:
> I am a Haskell newbie and I would like to hear your suggestions regarding a
> Database conectivity library:
> HSQL or HDBC ?
> which one is better / more actively supported?

I am the author of HDBC, so take this for what you will.

There were several things that bugged me about HSQL, if memory serves:

 1) It segfaulted periodically, at least with PostgreSQL

 2) It had memory leaks

 3) It couldn't read the result set incrementally.  That means that if
 you have a 2GB result set, you better have 8GB of RAM to hold it.

 4) It couldn't reference colums in the result set by position, only by

 5) It didn't support pre-compiled queries (replacable parameters)

 6) Its transaction handling didn't permit enough flexibility

I initially looked at fixing HSQL, but decided it would be easier to
actually write my own interface from scratch.

HDBC is patterned loosely after Perl's DBI, with a few thoughts from
Java's JDBC, Python's DB-API, and HSQL mixed in.

I believe it has fixed all of the above issues.  The HDBC backends that
I've written (Sqlite3, PostgreSQL, and ODBC) all use Haskell's C memory
management tools, which *should* ensure that there is no memory leakage.

I use it for production purposes in various applications at work,
connecting to both Free and proprietary databases.  I also use it in my
personal projects.  hpodder, for instance, stores podcast information in
a Sqlite3 database accessed via HDBC.  I have found HDBC+Sqlite3 to be a
particularly potent combination for a number of smaller projects.

http://software.complete.org/hdbc/wiki/HdbcUsers has a list of some
programs that are known to use HDBC.  Feel free to add yours to it.

-- John

More information about the Haskell-Cafe mailing list