[Pkg-haskell-commits] r1193 - in /packages/haskelldb-hsql-mysql: ./ branches/ branches/upstream/ branches/upstream/current/ branches/upstream/current/Database/ branches/upstream/current/Database/HaskellDB/ branches/upstream/current/Database/HaskellDB/HSQL/

arjan at users.alioth.debian.org arjan at users.alioth.debian.org
Wed Apr 30 22:09:13 UTC 2008


Author: arjan
Date: Wed Apr 30 22:09:13 2008
New Revision: 1193

URL: http://svn.debian.org/wsvn/pkg-haskell/?sc=1&rev=1193
Log:
[svn-inject] Installing original source of haskelldb-hsql-mysql

Added:
    packages/haskelldb-hsql-mysql/
    packages/haskelldb-hsql-mysql/branches/
    packages/haskelldb-hsql-mysql/branches/upstream/
    packages/haskelldb-hsql-mysql/branches/upstream/current/
    packages/haskelldb-hsql-mysql/branches/upstream/current/Database/
    packages/haskelldb-hsql-mysql/branches/upstream/current/Database/HaskellDB/
    packages/haskelldb-hsql-mysql/branches/upstream/current/Database/HaskellDB/HSQL/
    packages/haskelldb-hsql-mysql/branches/upstream/current/Database/HaskellDB/HSQL/MySQL.hs
    packages/haskelldb-hsql-mysql/branches/upstream/current/Setup.hs
    packages/haskelldb-hsql-mysql/branches/upstream/current/haskelldb-hsql-mysql.cabal

Added: packages/haskelldb-hsql-mysql/branches/upstream/current/Database/HaskellDB/HSQL/MySQL.hs
URL: http://svn.debian.org/wsvn/pkg-haskell/packages/haskelldb-hsql-mysql/branches/upstream/current/Database/HaskellDB/HSQL/MySQL.hs?rev=1193&op=file
==============================================================================
--- packages/haskelldb-hsql-mysql/branches/upstream/current/Database/HaskellDB/HSQL/MySQL.hs (added)
+++ packages/haskelldb-hsql-mysql/branches/upstream/current/Database/HaskellDB/HSQL/MySQL.hs Wed Apr 30 22:09:13 2008
@@ -1,0 +1,43 @@
+-----------------------------------------------------------
+-- |
+-- Module      :  Database.HaskellDB.HSQL.MySQL
+-- Copyright   :  HWT Group 2003,
+--                Bjorn Bringert 2006
+-- License     :  BSD-style
+-- 
+-- Maintainer  :  haskelldb-users at lists.sourceforge.net
+-- Stability   :  experimental
+-- Portability :  non-portable
+--
+-----------------------------------------------------------
+module Database.HaskellDB.HSQL.MySQL (MySQLOptions(..), mysqlConnect,
+                                      DriverInterface(..), driver) where
+
+import Database.HaskellDB.Database
+import Database.HaskellDB.HSQL
+import Database.HaskellDB.DriverAPI
+import Database.HaskellDB.Sql.MySQL (generator)
+import qualified Database.HSQL.MySQL as MySQL (connect) 
+
+data MySQLOptions = MySQLOptions { 
+                                  server :: String, -- ^ server name
+                                  db :: String,     -- ^ database name
+                                  uid :: String,    -- ^ user id
+                                  pwd :: String     -- ^ password
+                                 }
+
+mysqlConnect :: MonadIO m => MySQLOptions -> (Database -> m a) -> m a
+mysqlConnect opts = 
+    hsqlConnect generator (MySQL.connect (server opts) (db opts) (uid opts) (pwd opts))
+
+mysqlConnectOpts :: MonadIO m => [(String,String)] -> (Database -> m a) -> m a
+mysqlConnectOpts opts f = 
+    do
+    [a,b,c,d] <- getOptions ["server","db","uid","pwd"] opts
+    mysqlConnect (MySQLOptions {server = a, db = b,
+                                uid = c, pwd = d}) f
+
+-- | This driver requires the following options: 
+--   "server", "db", "uid", "pwd"
+driver :: DriverInterface
+driver = defaultdriver { connect = mysqlConnectOpts }

Added: packages/haskelldb-hsql-mysql/branches/upstream/current/Setup.hs
URL: http://svn.debian.org/wsvn/pkg-haskell/packages/haskelldb-hsql-mysql/branches/upstream/current/Setup.hs?rev=1193&op=file
==============================================================================
--- packages/haskelldb-hsql-mysql/branches/upstream/current/Setup.hs (added)
+++ packages/haskelldb-hsql-mysql/branches/upstream/current/Setup.hs Wed Apr 30 22:09:13 2008
@@ -1,0 +1,4 @@
+#!/usr/bin/env runghc
+
+import Distribution.Simple
+main = defaultMain

Added: packages/haskelldb-hsql-mysql/branches/upstream/current/haskelldb-hsql-mysql.cabal
URL: http://svn.debian.org/wsvn/pkg-haskell/packages/haskelldb-hsql-mysql/branches/upstream/current/haskelldb-hsql-mysql.cabal?rev=1193&op=file
==============================================================================
--- packages/haskelldb-hsql-mysql/branches/upstream/current/haskelldb-hsql-mysql.cabal (added)
+++ packages/haskelldb-hsql-mysql/branches/upstream/current/haskelldb-hsql-mysql.cabal Wed Apr 30 22:09:13 2008
@@ -1,0 +1,15 @@
+Name: haskelldb-hsql-mysql
+Version: 0.10
+Copyright: The authors
+Maintainer: haskelldb-users at lists.sourceforge.net
+Author: Daan Leijen, Conny Andersson, Martin Andersson, Mary Bergman, Victor Blomqvist, Bjorn Bringert, Anders Hockersten, Torbjorn Martin, Jeremy Shaw
+License: BSD3
+build-depends: haskell98, base, mtl, haskelldb, haskelldb-hsql, hsql, hsql-mysql
+Extensions: ExistentialQuantification,
+            OverlappingInstances,
+            UndecidableInstances,
+            MultiParamTypeClasses
+Synopsis: HaskellDB support for the HSQL MySQL driver.
+Exposed-Modules:
+        Database.HaskellDB.HSQL.MySQL
+ghc-options: -O2




More information about the Pkg-haskell-commits mailing list