Difference between revisions of "MetaHDBC"

From HaskellWiki
Jump to navigation Jump to search
m
m (Removing ToDo itmes that are done)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  +
= Short Introduction =
MetaHDBC is a project that will use [[Template_Haskell | Template Haskell]] and [http://software.complete.org/software/projects/show/hdbc HDBC] to do statically checked database access.
 
   
  +
MetaHDBC is a project that uses [[Template_Haskell | Template Haskell]] and [http://hackage.haskell.org/package/HDBC HDBC] to do statically checked database access. The programmer writes ordinary SQL, which is then validated by a relational database management system (RDMS). If the RDMS' ODBC driver supports type inference, then MetaHDBC also makes use of the infered types to do static type checking. Validation and type checking both occurs at compile-time.
For a little background, see this [http://www.nabble.com/Using-Template-Haskell-to-make-type-safe-database-access-td17027286.html haskell-cafe post] which got the project started.
 
   
  +
= Getting started with MetaHDBC =
[[MetaHDBC_Install | Installation notes for MetaHDBC]].
 
  +
  +
There is no real tutorial about MetaHDBC. Nonetheless, [http://lindstroem.wordpress.com/2008/09/18/metahdbc-paper-draft/ the MetaHDBC draft paper] will help you get started. Especially the first few chapters will be good for beginners.
  +
 
[[MetaHDBC_Install | Click here, if you want to install MetaHDBC]].
   
 
After installation you can look at the examples directory in the repository to get started easily with MetaHDBC.
 
After installation you can look at the examples directory in the repository to get started easily with MetaHDBC.
  +
 
For a little background, see this [http://www.nabble.com/Using-Template-Haskell-to-make-type-safe-database-access-td17027286.html haskell-cafe post] which got the project started.
  +
  +
= Status =
  +
  +
MetaHDBC is implemented and can be used, but it has some shortcomings.
  +
  +
MetaHDBC do not implement a SQL (or relational algebra) type inference engine itself. In stead it ask a RDMS (though ODBC) to infer the result of a SQL statement. Unfortunately, popular open source database like PostgreSQL, MySQL and SQLite do a poor job reporting the type of SQL statements. On the other hand, if you use IBM's DB2, you are in luck as DB2's ODBC driver do a good job of reporting the type of SQL statements. We have not tested MS SQL server's ability to report types of SQL statements, but we suspect it is also good. If you try to use MetaHDBC with MS SQL server, then please [mailto:mads_lindstroem@yahoo.dk report the results].
  +
  +
Second, MetaHDBC have not seen much use, so bugs may be lurking that has yet to be fixed.
  +
  +
= Tasks =
  +
  +
If you are interested in helping out with any of the following task, please [mailto:mads.lindstroem@gmail.com contact me]. If you have other tasks, that could help MetaHDBC, it would also be beneficiary to contact me before starting.
  +
  +
== Make popular open source database report type inference result though ODBC ==
  +
  +
For MetaHDBC to shine we need to RDMS's ODBC drivers to:
  +
  +
* report the type of SQL statements though ODBC, see [http://msdn.microsoft.com/en-us/library/ms710188.aspx SQLDescribeParam], [http://msdn.microsoft.com/en-us/library/ms716289(VS.85).aspx SQLDescribeCol], ...
  +
* we need the reported types to be available before we execute a SQL statement
  +
  +
Currently, we have found no open source database, which satisfy the two requirements above. This is unfortunately as it makes MetaHDBC a lot less valuable.

Latest revision as of 13:23, 31 July 2011

Short Introduction

MetaHDBC is a project that uses Template Haskell and HDBC to do statically checked database access. The programmer writes ordinary SQL, which is then validated by a relational database management system (RDMS). If the RDMS' ODBC driver supports type inference, then MetaHDBC also makes use of the infered types to do static type checking. Validation and type checking both occurs at compile-time.

Getting started with MetaHDBC

There is no real tutorial about MetaHDBC. Nonetheless, the MetaHDBC draft paper will help you get started. Especially the first few chapters will be good for beginners.

Click here, if you want to install MetaHDBC.

After installation you can look at the examples directory in the repository to get started easily with MetaHDBC.

For a little background, see this haskell-cafe post which got the project started.

Status

MetaHDBC is implemented and can be used, but it has some shortcomings.

MetaHDBC do not implement a SQL (or relational algebra) type inference engine itself. In stead it ask a RDMS (though ODBC) to infer the result of a SQL statement. Unfortunately, popular open source database like PostgreSQL, MySQL and SQLite do a poor job reporting the type of SQL statements. On the other hand, if you use IBM's DB2, you are in luck as DB2's ODBC driver do a good job of reporting the type of SQL statements. We have not tested MS SQL server's ability to report types of SQL statements, but we suspect it is also good. If you try to use MetaHDBC with MS SQL server, then please report the results.

Second, MetaHDBC have not seen much use, so bugs may be lurking that has yet to be fixed.

Tasks

If you are interested in helping out with any of the following task, please contact me. If you have other tasks, that could help MetaHDBC, it would also be beneficiary to contact me before starting.

Make popular open source database report type inference result though ODBC

For MetaHDBC to shine we need to RDMS's ODBC drivers to:

  • report the type of SQL statements though ODBC, see SQLDescribeParam, SQLDescribeCol, ...
  • we need the reported types to be available before we execute a SQL statement

Currently, we have found no open source database, which satisfy the two requirements above. This is unfortunately as it makes MetaHDBC a lot less valuable.