<div dir="ltr"><br><br><div class="gmail_quote">On Wed, Jul 7, 2010 at 9:46 PM, Jonathan Daugherty <span dir="ltr">&lt;<a href="mailto:drcygnus@gmail.com">drcygnus@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">&gt; Anyway, the point remains, we need a single goto database library.<br>
&gt;<br>
</div><div class="im">&gt; Though the lack of response to this thread makes me think no one<br>
&gt; particularly thinks this is a problem.<br>
<br>
</div>This is an interesting problem.  For my part, I suspect the<br>
proliferation of high-level database libraries is going to continue.<br>
If you were to convince the present package maintainers to pitch in<br>
and build a Grand Database Library, inevitably someone would come<br>
along and build another one for whatever reason.  Also, I don&#39;t think<br>
the dust has settled on techniques for database access in Haskell in<br>
any case, even for RDBMSs in particular.<br>
<br></blockquote><div>For what it&#39;s worth, I would be happy to get persistent[1] behind a Grand Database Library. Right now, the PostgreSQL backend[2] is built on HDBC while the SQLite backend[3] includes a variant of the direct-sqlite package[4]. Here&#39;s my two cents on why I didn&#39;t run with HDBC for both:</div>
<div><br></div><div>* I wanted the SQLite backend to be the default backend that anyone could use, without library dependencies. It would be nice if HDBC-sqlite3 had an option to build against the sqlite3 amalgamation instead of system libraries. (In fact, it would be cool if that were the default, and system libraries the option.)</div>
<div><br></div><div>* I&#39;m not fond of the Convertible typeclass. In particular, it makes no distinction between conversions which are guaranteed to succeed (Int -&gt; String) and conversions which might fail (String -&gt; Int). As a result, the fromSql function can easily throw a runtime error. (For that matter, toSql could as well, but that is much less likely.)</div>
<div><br></div><div>* I would like to be able to explicitly finalize statements. I believe I&#39;ve gotten some exceptions in the past when trying to close a database connection because some statements were not finalized, but I can&#39;t remember the details right now.</div>
<div><br></div><div>* I don&#39;t like that the lazy versions of functions are the default, and you have to add the &#39; for strict. It&#39;s too easy to make mistakes with the results of a lazy database query. I would even go so far as to recommend removing them entirely, but I think most people will not like that.</div>
<div><br></div><div>Overall, I think HDBC is a great library, but I have no experience with the alternatives.</div><div><br></div><div>The idea of breaking things into low-level C bindings and higher-level stuff on top is great.</div>
<div><br></div><div>Michael</div><div><br></div><div>[1] <a href="http://hackage.haskell.org/package/persistent">http://hackage.haskell.org/package/persistent</a></div><div>[2] <a href="http://hackage.haskell.org/package/persistent-postgresql">http://hackage.haskell.org/package/persistent-postgresql</a></div>
<div>[3] <a href="http://hackage.haskell.org/package/persistent-sqlite">http://hackage.haskell.org/package/persistent-sqlite</a></div><div>[4] <a href="http://hackage.haskell.org/package/direct-sqlite">http://hackage.haskell.org/package/direct-sqlite</a></div>
</div></div>