relational-query-HDBC- HDBC instance of relational-query and typed query interface for HDBC

Copyright2013 Kei Hibino
Safe HaskellNone



This module provides driver interface to load database system catalog via HDBC.



type TypeMap = [(String, TypeQ)] Source #

Mapping between type name string of DBMS and type in Haskell. Type name string depends on specification of DBMS system catalogs.

data Log Source #

Log string type for compile time.

runLog :: (String -> t) -> (String -> t) -> Log -> t Source #

Folding operation of Log type.

data LogChan Source #

Channel to store compile-time warning messages.

newLogChan :: Bool -> IO LogChan Source #

Build and return a new instance of LogChan.

takeLogs :: LogChan -> IO [Log] Source #

Take all logs list from channel.

putWarning :: LogChan -> String -> IO () Source #

Push a warning string into LogChan.

putError :: LogChan -> String -> IO () Source #

Push an error string into LogChan.

putVerbose :: LogChan -> String -> IO () Source #

Put verbose compile-time message as warning when verboseAsWarning.

failWith :: LogChan -> String -> MaybeT IO a Source #

Push an error string into LogChan and return failed context.

hoistMaybe :: Monad m => Maybe a -> MaybeT m a Source #

Hoist from Maybe context into MaybeT.

maybeIO :: b -> (a -> b) -> MaybeT IO a -> IO b Source #

Run MaybeT with default value.

data Driver conn Source #

Interface type to load database system catalog via HDBC.




emptyDriver :: IConnection conn => Driver conn Source #

Empty definition of Driver

getFields :: IConnection conn => Driver conn -> conn -> LogChan -> String -> String -> IO ([(String, TypeQ)], [Int]) Source #

Helper function to call getFieldsWithMap using typeMap of Driver.