From: Peter G. <pe...@gm...> - 2007-12-22 02:21:28
|
On 21/12/2007, at 11:52 PM, Bjorn Bringert wrote: > On Dec 21, 2007, at 17:43 , Justin Bailey wrote: >> Things I'd like to do still: >> >> * Representation of foreign-key relationships (ideally extracted >> from the DB) > > I believe Peter Gammie has some code for foreign key constrains. > Peter: is that ready to be pulled into HaskellDB? I can email you (== anyone who's interested) a patch that begins down that road. Roughly, I added support for defaults, foreign keys and primary keys. IIRC one can create tables with those things but the reflection is a bit weak, and the data description types are not fantastically robust. (The fieldnames are merely strings, e.g.) I haven't touched it for a few months now, as I decided it was less hassle to just use an SQL script. You will also need to renovate whatever DB backends you care about. (All Haskell DB bindings I looked at act as SQL bridges and treat tables merely as tuples.) I added some stuff to HSQL/PostgreSQL, and can email you those patches too, if you like. (I could port those to another <DB backend>/PostgreSQL if you can convince me there is some advantage in doing so - HSQL seemed to be simple, stable, etc. when I was looking into these things.) BTW what state is DBDirect in? I cannot compile hs-plugins (using GHC 6.6.1) presently, and I don't know what the future holds for that. Also BTW, I have some not-so-great patches that allow one to do character decoding/encoding at the database interface. I use these to get PostgreSQL to speak UTF-8. They seem to work well, if not particularly cleanly or efficiently. I think some refinement is not too much trouble if anyone is interested. cheers peter |