packages feed

haskelldb-hsql-postgresql (empty) → 0.10

raw patch · 3 files changed

+64/−0 lines, 3 filesdep +basedep +haskell98dep +haskelldbbuild-type:Customsetup-changed

Dependencies added: base, haskell98, haskelldb, haskelldb-hsql, hsql, hsql-postgresql, mtl

Files

+ Database/HaskellDB/HSQL/PostgreSQL.hs view
@@ -0,0 +1,45 @@+-----------------------------------------------------------+-- |+-- Module      :  Database.HaskellDB.HSQL.PostgreSQL+-- Copyright   :  HWT Group 2003,+--                Bjorn Bringert 2006+-- License     :  BSD-style+-- +-- Maintainer  :  haskelldb-users@lists.sourceforge.net+-- Stability   :  experimental+-- Portability :  non-portable+--+-----------------------------------------------------------+module Database.HaskellDB.HSQL.PostgreSQL (+		      PostgreSQLOptions(..), postgresqlConnect,+                      DriverInterface(..), driver+		      ) where++import Database.HaskellDB.Database+import Database.HaskellDB.HSQL+import Database.HaskellDB.DriverAPI+import Database.HaskellDB.Sql.PostgreSQL+import qualified Database.HSQL.PostgreSQL as PostgreSQL (connect) ++data PostgreSQLOptions = PostgreSQLOptions { +				  server :: String, -- ^ server name+				  db :: String,     -- ^ database name+				  uid :: String,    -- ^ user id+				  pwd :: String     -- ^ password+                  		 }++postgresqlConnect :: MonadIO m => PostgreSQLOptions -> (Database -> m a) -> m a+postgresqlConnect opts = +    hsqlConnect generator (PostgreSQL.connect (server opts) (db opts) (uid opts) (pwd opts))++postgresqlConnectOpts :: MonadIO m => [(String,String)] -> (Database -> m a) -> m a+postgresqlConnectOpts opts f = +    do+    [a,b,c,d] <- getOptions ["server","db","uid","pwd"] opts+    postgresqlConnect (PostgreSQLOptions {server = a, db = b,+                                          uid = c, pwd = d}) f++-- | This driver requires the following options: +--   "server", "db", "uid", "pwd"+driver :: DriverInterface+driver = defaultdriver { connect = postgresqlConnectOpts }
+ Setup.hs view
@@ -0,0 +1,4 @@+#!/usr/bin/env runghc++import Distribution.Simple+main = defaultMain
+ haskelldb-hsql-postgresql.cabal view
@@ -0,0 +1,15 @@+Name: haskelldb-hsql-postgresql+Version: 0.10+Copyright: The authors+Maintainer: haskelldb-users@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-postgresql+Extensions: ExistentialQuantification,+            OverlappingInstances,+            UndecidableInstances,+            MultiParamTypeClasses+Synopsis: HaskellDB support for the HSQL PostgreSQL driver.+Exposed-Modules:+        Database.HaskellDB.HSQL.PostgreSQL+ghc-options: -O2