[Pkg-haskell-commits] r1198 - in /packages/haskelldb-hsql-odbc: ./ 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:29:12 UTC 2008


Author: arjan
Date: Wed Apr 30 22:29:11 2008
New Revision: 1198

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

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

Added: packages/haskelldb-hsql-odbc/branches/upstream/current/Database/HaskellDB/HSQL/ODBC.hs
URL: http://svn.debian.org/wsvn/pkg-haskell/packages/haskelldb-hsql-odbc/branches/upstream/current/Database/HaskellDB/HSQL/ODBC.hs?rev=1198&op=file
==============================================================================
--- packages/haskelldb-hsql-odbc/branches/upstream/current/Database/HaskellDB/HSQL/ODBC.hs (added)
+++ packages/haskelldb-hsql-odbc/branches/upstream/current/Database/HaskellDB/HSQL/ODBC.hs Wed Apr 30 22:29:11 2008
@@ -1,0 +1,55 @@
+-----------------------------------------------------------
+-- |
+-- Module      :  Database.HaskellDB.HSQL.ODBC
+-- 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.ODBC (
+		                     ODBCOptions(..),
+		                     odbcConnect, 
+                                     odbcDriverConnect,
+                                     DriverInterface(..),
+		                     driver
+		                    ) where
+
+import Database.HaskellDB.Database
+import Database.HaskellDB.HSQL
+import Database.HaskellDB.DriverAPI
+import Database.HaskellDB.Sql.Generate (SqlGenerator)
+import qualified Database.HSQL.ODBC as ODBC (connect, driverConnect) 
+
+data ODBCOptions = ODBCOptions { 
+                               dsn :: String, -- ^ name binding in ODBC
+                               uid :: String, -- ^ user id
+                               pwd :: String  -- ^ password
+                  	       }          
+
+odbcConnect :: MonadIO m => SqlGenerator -> ODBCOptions -> (Database -> m a) -> m a
+odbcConnect gen opts = 
+    hsqlConnect gen (ODBC.connect (dsn opts) (uid opts) (pwd opts))
+
+-- | DSN-less connection.
+odbcDriverConnect :: MonadIO m => SqlGenerator -> String -> (Database -> m a) -> m a
+odbcDriverConnect gen opts =
+    hsqlConnect gen (ODBC.driverConnect opts)
+
+odbcConnectOpts :: MonadIO m => [(String,String)] -> (Database -> m a) -> m a
+odbcConnectOpts opts f = 
+    do
+    [a,b,c] <- getOptions ["dsn","uid","pwd"] opts
+    g <- getGenerator opts
+    odbcConnect g (ODBCOptions {dsn = a,
+                                uid = b,
+			        pwd = c}) f
+
+-- | This driver requires the following options: 
+--   "dsn", "uid", "pwd"
+driver :: DriverInterface
+driver = defaultdriver { connect = odbcConnectOpts }

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

Added: packages/haskelldb-hsql-odbc/branches/upstream/current/haskelldb-hsql-odbc.cabal
URL: http://svn.debian.org/wsvn/pkg-haskell/packages/haskelldb-hsql-odbc/branches/upstream/current/haskelldb-hsql-odbc.cabal?rev=1198&op=file
==============================================================================
--- packages/haskelldb-hsql-odbc/branches/upstream/current/haskelldb-hsql-odbc.cabal (added)
+++ packages/haskelldb-hsql-odbc/branches/upstream/current/haskelldb-hsql-odbc.cabal Wed Apr 30 22:29:11 2008
@@ -1,0 +1,15 @@
+Name: haskelldb-hsql-odbc
+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-odbc
+Extensions: ExistentialQuantification,
+            OverlappingInstances,
+            UndecidableInstances,
+            MultiParamTypeClasses
+Synopsis: HaskellDB support for the HSQL ODBC driver.
+Exposed-Modules:
+        Database.HaskellDB.HSQL.ODBC
+ghc-options: -O2




More information about the Pkg-haskell-commits mailing list