Pure Haskell MySQL bindings in the works

I’ve spent a few spare hours here and there working on a pure Haskell interface to MySQL recently. On the principle that perhaps someone else might want to join in the fun, I’ve published a darcs repository already (see the link above for more details):

darcs get http://darcs.serpentine.com/mysql

There are a few reasons I’m doing this. One is licensing-related: the existing hsql-mysql bindings claim to be BSD-licensed, but they’re just an FFI wrapper around the MySQL client library, so they (and any program that uses them) are subject to the GPL. My library speaks the MySQL wire protocol in pure Haskell, and I’ve BSD-licensed it.

The code isn’t actually usable for applications yet, as I’ve mainly done the work of getting login (a major pain) and querying working. I’ve spent a lot of time with the following very handy references:

This has also been a great opportunity to see how well Hackage, Haskell’s equivalent of CPAN, is working out in practice. When I wanted a library that would help me to decode and encode the wire protocol efficiently and flexibly, I was able to grab binary. When I subsequently needed SHA-1 hash support to implement the password hashing protocol, I downloaded the crypto package. No muss, no fuss.

Posted in haskell, open source
2 comments on “Pure Haskell MySQL bindings in the works
  1. Felix says:

    Hi Bryan

    I don’t have a need for a MySQL binding myself, but it is good to know that it will be available in the future. Practical libraries like this is what Haskell needs for it to be used more often. Keep up the good work.

  2. Chris says:

    Hmm. The darcs repo appears to be 404. Did you move this?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>