Hi, folks -<div><br></div><div>Over the past few days, I&#39;ve released two MySQL-related packages on Hackage that I think should be pretty useful.</div><div><br></div><div>The first is mysql-simple: <a href="http://hackage.haskell.org/package/mysql-simple">http://hackage.haskell.org/package/mysql-simple</a></div>
<div><br></div><div>This is a mid-level binding to the MySQL client API. I aimed it squarely at being both fast and easy to use, and I&#39;m very pleased with the results so far.</div><div><ul><li>Performance: compared to HDBC-mysql, mysql-simple yields a 60% performance improvement on my real-world application.</li>
<li>Ease of use: compared again to HDBC, my real-world application&#39;s DB-specific code shrunk by 50% while achieving the above performance increase.</li><li>Type safety: it&#39;s intentionally hard to construct SQL queries by string concatenation, but of course I provide some nice safe APIs for formatting queries and converting results. That safety does not come at the expense of performance or expressive bloat, as the above results indicate.</li>
</ul></div><div>Because I know that some people favour interacting with their databases via a model such as iteratees, the mysql-simple library is built on top of a very lightweight library.</div><div><br></div><div>That lower-level library is named mysql: <a href="http://hackage.haskell.org/package/mysql">http://hackage.haskell.org/package/mysql</a></div>
<div><br></div><div>This is a low-level binding to the MySQL client API. It is aimed at high performance and simplicity, but more specifically for consumption by authors of higher-level database libraries. It is bare enough of features that it doesn&#39;t even perform conversion between Haskell and SQL types, but at the same time it uses bytestrings sensibly, cheaply avoids some nasty signal interruption problems with the MySQL client library, and abstracts some of the tiresome details of memory management. It gives a higher-level library complete control over result conversion, how to fetch results, and all that, so you can focus purely on building iteratees and not the lower-level gunk.</div>
<div><br></div><div>Enjoy!</div><div>B.</div>