waterson: HDBC-mysql
home

HDBC-mysql

HDBC-mysql is an HDBC driver for the MySQL database. It's available via Hackage, so the easiest way to install it is with Cabal:

     cabal install HDBC-mysql

It is licensed under LGPL2*, and you are free to examine the source in the darcs repository:

     darcs get http://www.maubi.net/~waterson/REPO/HDBC-mysql

(Note that this repository is a darcs 2.0 repository, and you can't pull it with darcs 1.x.)

It is a "native" HDBC driver for MySQL that makes use of libmysqlclient to communicate with a MySQL server. By way of synopsis:

     import Control.Monad
     import Database.HDBC
     import Database.HDBC.MySQL
     main = do conn <- connectMySQL defaultMySQLConnectInfo {
                         mysqlHost     = "db1.example.com",
                         mysqlUser     = "scott",
                         mysqlPassword = "tiger"
                      }

               rows <- quickQuery' conn "SELECT 1 + 1" []
               forM_ rows $ \row -> putStrLn $ show row

At the moment, please consider this to be "alpha" software. As far as I can tell, it works. There are some limitations that you should be aware of.

As time permits, I'll attempt to address each of these shortcomings, or any others that you may find. Please feel free to contact me if you have any questions, suggestions, or discover problems!

* It's licensed under LGPL2 for no other reason than this is the same license that is used by libmysqlclient. If you think you need to use another license, I'm really not particular: just ask.