From: Bjorn B. <d00...@dt...> - 2005-02-22 21:17:33
|
Frederik Eaton wrote: > I wrote some functions which can be used with HSQL to make it a lot > more concise, using the HList concept: >=20 > http://ofb.net/~frederik/SqlRow/ >=20 > If anybody wants to look at it and give feedback. Maybe it could be > incorporated into the library. One difference to the current HSQL is that you access record fields by=20 position rather than by name. Not sure whether this is good or bad. One=20 problem is that there is as little type safety now as before, and it's=20 as easy to access a non-existing field. The nice thing is that you can get back a whole row at a time, and I=20 like the pattern trick in: getRows stmt >>=3D mapM_ (\ (m :. n :. p :. Nil) -> All in all I think it is a very good demonstration of what you can do=20 with heterogenous lists, and it's not really worse than HSQL when it=20 comes to type-safety. You might want to have a look at HaskellDB,=20 http://haskelldb.sourceforge.net/ . It uses a similar scheme for record=20 types. It adds a layer of type safety, and you construct the queries=20 using combinators. You might want to be careful with collectRowsAsync. We have the same=20 thing in HaskellDB, and it turns out to be a problem with some databases=20 if you run a second query without getting all that data from the first=20 one. I think MySQL with the native drivers does it for example, but not=20 with ODBC. > Is there anyone on this list? Yes. /Bj=F6rn |