haskelldb-hdbc-odbc-2.1.2/0000755000000000000000000000000012042267650013442 5ustar0000000000000000haskelldb-hdbc-odbc-2.1.2/Setup.hs0000644000000000000000000000010512042267650015072 0ustar0000000000000000#!/usr/bin/env runghc import Distribution.Simple main = defaultMain haskelldb-hdbc-odbc-2.1.2/LICENSE0000644000000000000000000000307512042267650014454 0ustar0000000000000000Copyright (c) 1999 Daan Leijen, daan@cs.uu.nl Copyright (c) 2003-2004 The HaskellDB development team All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the names of the copyright holders nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. haskelldb-hdbc-odbc-2.1.2/haskelldb-hdbc-odbc.cabal0000644000000000000000000000165412042267650020170 0ustar0000000000000000Name: haskelldb-hdbc-odbc Version: 2.1.2 Cabal-version: >= 1.6 Build-type: Simple Copyright: The authors Homepage: https://github.com/m4dc4p/haskelldb 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 License-file: LICENSE Synopsis: HaskellDB support for the HDBC ODBC driver. Description: HaskellDB requires this driver if HDBC will be used to connect to an ODBC database. Category: Database Library Build-depends: mtl >= 1 && < 3, haskelldb >= 2 && < 3, haskelldb-hdbc >= 2 && < 3, HDBC >= 2 && < 3, HDBC-odbc >= 2 && < 3, base >= 3 && < 5 Exposed-Modules: Database.HaskellDB.HDBC.ODBC Executable DBDirect-hdbc-odbc Main-is: DBDirect.hs Source-repository head Type: git Location: https://github.com/m4dc4p/haskelldb haskelldb-hdbc-odbc-2.1.2/DBDirect.hs0000644000000000000000000000015512042267650015417 0ustar0000000000000000import Database.HaskellDB.HDBC.ODBC import Database.HaskellDB.DBDirect main :: IO () main = dbdirect driver haskelldb-hdbc-odbc-2.1.2/Database/0000755000000000000000000000000012042267650015146 5ustar0000000000000000haskelldb-hdbc-odbc-2.1.2/Database/HaskellDB/0000755000000000000000000000000012042267650016737 5ustar0000000000000000haskelldb-hdbc-odbc-2.1.2/Database/HaskellDB/HDBC/0000755000000000000000000000000012042267650017437 5ustar0000000000000000haskelldb-hdbc-odbc-2.1.2/Database/HaskellDB/HDBC/ODBC.hs0000644000000000000000000000264512042267650020511 0ustar0000000000000000----------------------------------------------------------- -- | -- Module : Database.HaskellDB.HDBC.ODBC -- Copyright : HWT Group (c) 2003, Bjorn Bringert (c) 2006 -- License : BSD-style -- -- Maintainer : haskelldb-users@lists.sourceforge.net -- Stability : experimental -- Portability : portable -- ----------------------------------------------------------- module Database.HaskellDB.HDBC.ODBC ( odbcConnect, DriverInterface(..), driver ) where import Database.HaskellDB.Database import Database.HaskellDB.HDBC import Database.HaskellDB.DriverAPI import Database.HaskellDB.Sql.Generate (SqlGenerator) import Database.HDBC.ODBC (connectODBC) odbcConnect :: MonadIO m => SqlGenerator -> [(String,String)] -> (Database -> m a) -> m a odbcConnect gen opts = hdbcConnect gen (connectODBC conninfo) -- strangely enough, mysql+unixodbc want a semicolon terminating connstring where conninfo = foldr (\(k,v) z -> k ++ "=" ++ v ++ ";" ++ z) [] opts options :: [(String, String)] options = [] odbcConnectOpts :: MonadIO m => [(String,String)] -> (Database -> m a) -> m a odbcConnectOpts opts f = do gen <- getGenerator opts let opts' = filter ((/="generator") . fst) opts odbcConnect gen opts' f -- | This driver passes its options through to HDBC. driver :: DriverInterface driver = defaultdriver { connect = odbcConnectOpts, requiredOptions = options }