Module Database.ERD.Generic

Generic operations and integrity tests to support the database code generated from ERDs

Summary of exported operations:

showDatabaseKey :: String -> (a -> Int) -> a -> String  Deterministic 
Shows a database key for an entity name as a string.
readDatabaseKey :: String -> (Int -> a) -> String -> Maybe a  Deterministic 
Transforms a string into a key for an entity name.
newEntry :: Show a => (Int -> a -> Dynamic) -> (Int -> a -> b) -> a -> Transaction b  Deterministic 
Insert a new entity and assign a new key for it.
newEntryR :: (Show a, Show b) => (Int -> (a,b) -> Dynamic) -> a -> b -> Transaction ()  Deterministic 
getEntry :: (Read a, Show a) => (Int -> a -> Dynamic) -> (Int -> a -> b) -> Int -> Transaction b  Deterministic 
deleteEntryR :: (Eq a, Read a, Show a, Eq b, Read b, Show b) => (Int -> (a,b) -> Dynamic) -> a -> b -> Transaction ()  Deterministic 
existsEntryWithDBKey :: (Read a, Show a) => String -> (Int -> a -> Dynamic) -> Int -> Transaction ()  Deterministic 
requiredForeignDBKey :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> b -> Transaction ()  Deterministic 
getAllEntities :: (Read a, Show a) => (Int -> a -> Dynamic) -> (Int -> a -> b) -> Query [b]  Deterministic 
duplicateKeyTest :: (Int -> a -> Dynamic) -> Transaction ()  Deterministic 
duplicatePTest :: Eq a => [a] -> Transaction ()  Deterministic 
unique :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> b -> Transaction ()  Deterministic 
uniqueUpdate :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> Int) -> (c -> b) -> c -> Transaction ()  Deterministic 
uniqueC :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> c -> Transaction ()  Deterministic 
unique2 :: (Eq a, Read a, Show a, Eq b, Read b, Show b) => (Int -> (a,b) -> Dynamic) -> a -> b -> Transaction ()  Deterministic 
unique2C :: (Eq a, Read a, Show a, Eq b, Read b, Show b) => (Int -> (a,b) -> Dynamic) -> a -> b -> Transaction ()  Deterministic 
maxPTest :: Int -> [a] -> Transaction ()  Deterministic 
maxTest :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> Int -> b -> Transaction ()  Deterministic 
maxTestUpdate :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> Int) -> (c -> b) -> Int -> c -> Transaction ()  Deterministic 
maxTestC :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> Int -> b -> Transaction ()  Deterministic 
minTestC :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> Int -> b -> Transaction ()  Deterministic 
maxTestInsert :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> Int -> b -> Transaction ()  Deterministic 
minTestDelete :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> Int -> b -> Transaction ()  Deterministic 
saveDBTerms :: (Read a, Show a, Show b) => String -> String -> (Int -> a -> Dynamic) -> (Int -> a -> b) -> IO ()  Deterministic 
restoreDBTerms :: (Show a, Read b) => String -> String -> (Int -> a -> Dynamic) -> (b -> Int) -> (b -> a) -> IO ()  Deterministic 
restoreDBRelTerms :: (Show a, Read b) => String -> String -> (Int -> a -> Dynamic) -> (b -> a) -> IO ()  Deterministic 
defaultString :: String -> String -> String  Deterministic 

Exported datatypes:


Key

The general type of database keys.

Type synonym: Key = Int


Exported operations:

showDatabaseKey :: String -> (a -> Int) -> a -> String  Deterministic 

Shows a database key for an entity name as a string. Useful if a textual representation of a database key is necessary, e.g., as URL parameters in web pages. This textual representation should not be used to store database keys in attributes!

readDatabaseKey :: String -> (Int -> a) -> String -> Maybe a  Deterministic 

Transforms a string into a key for an entity name. Nothing is returned if the string does not represent a reasonable key.

newEntry :: Show a => (Int -> a -> Dynamic) -> (Int -> a -> b) -> a -> Transaction b  Deterministic 

Insert a new entity and assign a new key for it.

newEntryR :: (Show a, Show b) => (Int -> (a,b) -> Dynamic) -> a -> b -> Transaction ()  Deterministic 

getEntry :: (Read a, Show a) => (Int -> a -> Dynamic) -> (Int -> a -> b) -> Int -> Transaction b  Deterministic 

deleteEntryR :: (Eq a, Read a, Show a, Eq b, Read b, Show b) => (Int -> (a,b) -> Dynamic) -> a -> b -> Transaction ()  Deterministic 

existsEntryWithDBKey :: (Read a, Show a) => String -> (Int -> a -> Dynamic) -> Int -> Transaction ()  Deterministic 

requiredForeignDBKey :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> b -> Transaction ()  Deterministic 

getAllEntities :: (Read a, Show a) => (Int -> a -> Dynamic) -> (Int -> a -> b) -> Query [b]  Deterministic 

duplicateKeyTest :: (Int -> a -> Dynamic) -> Transaction ()  Deterministic 

duplicatePTest :: Eq a => [a] -> Transaction ()  Deterministic 

unique :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> b -> Transaction ()  Deterministic 

uniqueUpdate :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> Int) -> (c -> b) -> c -> Transaction ()  Deterministic 

uniqueC :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> c -> Transaction ()  Deterministic 

unique2 :: (Eq a, Read a, Show a, Eq b, Read b, Show b) => (Int -> (a,b) -> Dynamic) -> a -> b -> Transaction ()  Deterministic 

unique2C :: (Eq a, Read a, Show a, Eq b, Read b, Show b) => (Int -> (a,b) -> Dynamic) -> a -> b -> Transaction ()  Deterministic 

maxPTest :: Int -> [a] -> Transaction ()  Deterministic 

maxTest :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> Int -> b -> Transaction ()  Deterministic 

maxTestUpdate :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> Int) -> (c -> b) -> Int -> c -> Transaction ()  Deterministic 

maxTestC :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> Int -> b -> Transaction ()  Deterministic 

minTestC :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> Int -> b -> Transaction ()  Deterministic 

maxTestInsert :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> Int -> b -> Transaction ()  Deterministic 

minTestDelete :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> Int -> b -> Transaction ()  Deterministic 

saveDBTerms :: (Read a, Show a, Show b) => String -> String -> (Int -> a -> Dynamic) -> (Int -> a -> b) -> IO ()  Deterministic 

restoreDBTerms :: (Show a, Read b) => String -> String -> (Int -> a -> Dynamic) -> (b -> Int) -> (b -> a) -> IO ()  Deterministic 

restoreDBRelTerms :: (Show a, Read b) => String -> String -> (Int -> a -> Dynamic) -> (b -> a) -> IO ()  Deterministic 

defaultString :: String -> String -> String  Deterministic