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  Non-deterministic 
Transforms a string into a key for an entity name.
newEntry :: Show a => (Int -> a -> Dynamic) -> (Int -> a -> b) -> a -> Transaction b  Non-deterministic 
Insert a new entity and assign a new key for it.
newEntryR :: (Show a, Show b) => (Int -> (a,b) -> Dynamic) -> a -> b -> Transaction ()  Non-deterministic 
getEntry :: (Read a, Show a) => (Int -> a -> Dynamic) -> (Int -> a -> b) -> Int -> Transaction b  Non-deterministic 
deleteEntryR :: (Eq a, Read a, Show a, Eq b, Read b, Show b) => (Int -> (a,b) -> Dynamic) -> a -> b -> Transaction ()  Non-deterministic 
existsEntryWithDBKey :: (Read a, Show a) => String -> (Int -> a -> Dynamic) -> Int -> Transaction ()  Non-deterministic 
requiredForeignDBKey :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> b -> Transaction ()  Non-deterministic 
getAllEntities :: (Read a, Show a) => (Int -> a -> Dynamic) -> (Int -> a -> b) -> Query [b]  Non-deterministic 
duplicateKeyTest :: (Int -> a -> Dynamic) -> Transaction ()  Non-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 ()  Non-deterministic 
uniqueUpdate :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> Int) -> (c -> b) -> c -> Transaction ()  Non-deterministic 
uniqueC :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> c -> Transaction ()  Non-deterministic 
unique2 :: (Eq a, Read a, Show a, Eq b, Read b, Show b) => (Int -> (a,b) -> Dynamic) -> a -> b -> Transaction ()  Non-deterministic 
unique2C :: (Eq a, Read a, Show a, Eq b, Read b, Show b) => (Int -> (a,b) -> Dynamic) -> a -> b -> Transaction ()  Non-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 ()  Non-deterministic 
maxTestUpdate :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> Int) -> (c -> b) -> Int -> c -> Transaction ()  Non-deterministic 
maxTestC :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> Int -> b -> Transaction ()  Non-deterministic 
minTestC :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> Int -> b -> Transaction ()  Non-deterministic 
maxTestInsert :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> Int -> b -> Transaction ()  Non-deterministic 
minTestDelete :: (Read a, Show a, Eq b, Show b) => String -> (Int -> a -> Dynamic) -> (Int -> a -> c) -> (c -> b) -> Int -> b -> Transaction ()  Non-deterministic 
saveDBTerms :: (Read a, Show a, Show b) => String -> String -> (Int -> a -> Dynamic) -> (Int -> a -> b) -> IO ()  Non-deterministic 
restoreDBTerms :: (Show a, Read b) => String -> String -> (Int -> a -> Dynamic) -> (b -> Int) -> (b -> a) -> IO ()  Non-deterministic 
restoreDBRelTerms :: (Show a, Read b) => String -> String -> (Int -> a -> Dynamic) -> (b -> a) -> IO ()  Non-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  Non-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  Non-deterministic 

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

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

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

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

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

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

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

duplicateKeyTest :: (Int -> a -> Dynamic) -> Transaction ()  Non-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 ()  Non-deterministic 

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

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

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

unique2C :: (Eq a, Read a, Show a, Eq b, Read b, Show b) => (Int -> (a,b) -> Dynamic) -> a -> b -> Transaction ()  Non-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 ()  Non-deterministic 

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

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

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

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

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

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

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

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

defaultString :: String -> String -> String  Deterministic