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

Copyright2013 Kei Hibino
LicenseBSD3
Maintainerex8k.hibino@gmail.com
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Database.HDBC.Schema.Driver

Description

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

Synopsis

Documentation

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.

Constructors

Driver 

Fields

typeMap :: TypeMap

Custom type mapping of this driver

getFieldsWithMap :: TypeMap -> conn -> LogChan -> String -> String -> IO ([(String, TypeQ)], [Int])

Get column name and Haskell type pairs and not-null columns index.

getPrimaryKey :: conn -> LogChan -> String -> String -> IO [String]

Get primary key column name.

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.