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

Copyright2013-2017 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

emptyDriver :: IConnection conn => Driver conn Source #

Empty definition of Driver

getFields Source #

Arguments

:: IConnection conn 
=> Driver conn

driver record

-> conn

connection

-> LogChan

log channel

-> String

schema name string

-> String

table name string

-> IO ([(String, TypeQ)], [Int]) 

Helper function to call getFieldsWithMap using typeMap of Driver.