
Having used HToolkit successfully to extract information from a MySQL database, I am painfully aware of the limitations of sending embedded SQL strings and finding out at runtime that something didn't quite work (in an often subtle and difficult to track down way). I'd love to be able to put HaskellDB on top of HToolkit. There are two approaches: i) add extensible records to ghc or ii) modify HaskellDB so it uses Haskell records not extensible records (I'd have modify HaskellDB anyway to use HToolkit rather than talk to ODBC directly). The latter sounds as though it might be more feasible that the former. Having read the paper and briefly looked at the code, I assume the extensibility is required if you have two tables each with the same column name and therefore you want to use the same label in two different records. Obviously you can't do this with Haskell records as the labels become top level functions. However, if I rename labels then I won't have this problem. For example, if I have two tables, passwd and notify each containing a column called email then I could have labels notifyEmail and passwdEmail and remember that they really referred to email. Does anyone have any views on this? Dominic Steinitz

I have some code I've been working on to access my own SQL engine. The issues should be identical with accessing another engine. I think a simpler and better solution is to use the fully qualified column name, which has to be unique. This conforms to the ANSI standard, which is always a plus. Thus you have a column name like owner.table.columnName. The dots can be replaced by underscores in an environment where the dots cause problems. On 26-Jan-2003 Dominic Steinitz wrote:
Having used HToolkit successfully to extract information from a MySQL database, I am painfully aware of the limitations of sending embedded SQL strings and finding out at runtime that something didn't quite work (in an often subtle and difficult to track down way).
I'd love to be able to put HaskellDB on top of HToolkit. There are two approaches: i) add extensible records to ghc or ii) modify HaskellDB so it uses Haskell records not extensible records (I'd have modify HaskellDB anyway to use HToolkit rather than talk to ODBC directly). The latter sounds as though it might be more feasible that the former. Having read the paper and briefly looked at the code, I assume the extensibility is required if you have two tables each with the same column name and therefore you want to use the same label in two different records. Obviously you can't do this with Haskell records as the labels become top level functions. However, if I rename labels then I won't have this problem. For example, if I have two tables, passwd and notify each containing a column called email then I could have labels notifyEmail and passwdEmail and remember that they really referred to email.
Does anyone have any views on this?
Dominic Steinitz
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
---------------------------------- Seth Kurtzberg M. I. S. Corp. E-Mail: seth@cql.com Date: 26-Jan-2003 Time: 10:01:05 This message was sent by XFMail ----------------------------------
participants (2)
-
Dominic Steinitz
-
seth@cql.com