This library provides low-level native Haskell bindings for the popular MySQL database. The bindings are written in pure Haskell, and do not use the Foreign Function Interface.
Why another library?
There already exists another MySQL client library, hsql-mysql. That library uses MySQL AB’s client library, and hence is subject to the terms of either the GNU General Public License or MySQL’s commercial license. (The hsql-mysql page states that it is BSD-licensed, but this is incorrect.)
In addition, because this library is written in pure Haskell, it opens up some interesting possibilities not open to other MySQL bindings. Watch this space for details.
License
This library is licensed under the BSD license.
Status
Note: This library is under heavy development, and has not yet reached an official release milestone.
The library can currently talk successfully to MySQL 4.1 servers. It is not yet by any means fully featured.
Download
The darcs repository is available from here:
darcs get http://darcs.serpentine.com/mysql
I’ve submitted some patches to Dominic for the Haskell Crypto library, which this library uses for password authentication. Until Dominic takes my patches, you’ll also need my modified tree:
darcs get http://darcs.serpentine.com/crypto
seems you also need the darcs version of binary, to get getLazyByteStringNul
Looks like the bindings are no longer at darcs.serpentine.com. Neither is the crypto library. What happened?
Hi Bryan,
I’ve been doing the same thing for Scheme, specifically for Gambit and it’s turning out to be a painful exercise.
I’m guessing that you are using
http://forge.mysql.com/wiki/MySQL_Internals_ClientServer_Protocol#Long_Data_Packet_.28Tentative_Description.29
as your main source of reference ? Have you noticed that there are quiet a few omissions and ambiguities in that document ? I find that I’m constantly having to refer to the C or Java interface to try and work out what’s going on.
So far I’ve got authentication working (new and old methods), dynamic queries, updates and result sets. I haven’t done binary data yet but have started on prepared statements. I’m not planning on doing compression or SSL support at this stage.
How are you getting on ? Good luck – there are very few socket level clients knocking around.
Regards
Andrew
So far, I’ve been reading the C source, for exactly the reasons you mention. But I haven’t worked on this in perhaps a year now, and the code is still incomplete.