
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Does anyone know if there is work being done on a standard Haskell database interface. I was very impressed with HaskellDB but I understand that it uses Haskell extensions not present in GHC. Tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/OhsFYha8TWXIQwoRAhkUAKDE/z2fepe7565J5+9JmMGZxpmQvwCgre/R JokIUilP8aF37d764FYFZbY= =Zlx6 -----END PGP SIGNATURE-----

Thomas L. Bevan writes: | Does anyone know if there is work being done on a standard Haskell | database interface. I suspect that there isn't. The pattern seems to be that someone gets an interface working well enough for some purposes, and perhaps shares it, but is too modest and/or busy to put it forward as a standard. For a row extraction mechanism, I'd vote for passing an extraction function (or IO action) to the main query function, like Tim Docker described last month. http://haskell.cs.yale.edu/pipermail/haskell-cafe/2003-July/004684.html This is a pretty good way to stop those nasty vague SQL row types at the Haskell border and turn them into something respectable. Perhaps it would even be worth constraining the extracted type to be in DeepSeq doquery :: (DeepSeq v) => Process -> String -> IO v -> IO [v] so that the interface clearly may confine its attention to one row at a time per cursor. - Tom

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This type of interface is fine as far as it goes, but there is only ever a loose coupling between the database and application. The HaskellDB work implemented a relational calculus that ensured that all queries were checked at compile time for validity against a particular database. The problem with HaskellDB is that it defines a join operator that generates new types. Tom On Wed, 13 Aug 2003 02:02 am, Tom Pledger wrote:
Thomas L. Bevan writes: | Does anyone know if there is work being done on a standard Haskell | database interface.
I suspect that there isn't. The pattern seems to be that someone gets an interface working well enough for some purposes, and perhaps shares it, but is too modest and/or busy to put it forward as a standard.
For a row extraction mechanism, I'd vote for passing an extraction function (or IO action) to the main query function, like Tim Docker described last month.
http://haskell.cs.yale.edu/pipermail/haskell-cafe/2003-July/004684.html
This is a pretty good way to stop those nasty vague SQL row types at the Haskell border and turn them into something respectable. Perhaps it would even be worth constraining the extracted type to be in DeepSeq
doquery :: (DeepSeq v) => Process -> String -> IO v -> IO [v]
so that the interface clearly may confine its attention to one row at a time per cursor.
- Tom
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQE/Oj51Yha8TWXIQwoRAq0EAKCdfxWtB+D6cmZyOr7udXTXZtEgqQCgqIJM rvLjcYXJouR0Q59XkyC4/L4= =7F1i -----END PGP SIGNATURE-----

Thomas L. Bevan writes: : | This type of interface is fine as far as it goes, but there is only | ever a loose coupling between the database and application. | | The HaskellDB work implemented a relational calculus that ensured | that all queries were checked at compile time for validity against | a particular database. That validation is a Good Thing - as long as you're confident that your database's schema won't change between compile time and run time. Schema changes can even happen after you've connected to the database at run time but before you send your query, so it makes sense to have an InvalidSchema exception for cursor opening. (Database servers should prevent schema changes which undermine already open cursors.) To get true end-to-end validation, the client program must somehow be registered with the database server as Something Which Cares About Schema. Also, its queries must be expressed simply enough that they can be analysed statically. These difficulties are related to the use of SQL /source/ code to express queries at /run/ time - a deeply entrenched practice! - Tom
participants (2)
-
Thomas L. Bevan
-
Tom Pledger