Generic operations and integrity tests to support the database code generated from ERDs
type Key
= Int
The general type of database keys.
showDatabaseKey
:: String -> (a -> Int) -> a -> String
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
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
Insert a new entity and assign a new key for it.
newEntryR
:: (Show a, Show b) => (Int -> (a, b) -> Dynamic) -> a -> b -> Transaction ()
getEntry
:: (Read a, Show a) => (Int -> a -> Dynamic) -> (Int -> a -> b) -> Int -> Transaction b
deleteEntryR
:: (Eq a, Read a, Show a, Eq b, Read b, Show b) => (Int -> (a, b) -> Dynamic) -> a -> b -> Transaction ()
existsEntryWithDBKey
:: (Read a, Show a) => String -> (Int -> a -> Dynamic) -> Int -> Transaction ()
requiredForeignDBKey
:: (Read a, Show a, Eq c, Show c) => String -> (Int -> a -> Dynamic) -> (Int -> a -> b) -> (b -> c) -> c -> Transaction ()
getAllEntities
:: (Read a, Show a) => (Int -> a -> Dynamic) -> (Int -> a -> b) -> Query [b]
duplicateKeyTest
:: (Int -> a -> Dynamic) -> Transaction ()
duplicatePTest
:: Eq a => [a] -> Transaction ()
unique
:: (Read a, Show a, Eq c, Show c) => String -> (Int -> a -> Dynamic) -> (Int -> a -> b) -> (b -> c) -> c -> Transaction ()
uniqueUpdate
:: (Read a, Show a, Eq c, Show c) => String -> (Int -> a -> Dynamic) -> (Int -> a -> b) -> (b -> Int) -> (b -> c) -> b -> Transaction ()
uniqueC
:: (Read a, Show a, Eq c, Show c) => String -> (Int -> a -> Dynamic) -> (Int -> a -> b) -> (b -> c) -> b -> Transaction ()
unique2
:: (Eq a, Eq b, Read a, Read b, Show a, Show b) => (Int -> (a, b) -> Dynamic) -> a -> b -> Transaction ()
unique2C
:: (Eq a, Eq b, Read a, Read b, Show a, Show b) => (Int -> (a, b) -> Dynamic) -> a -> b -> Transaction ()
maxPTest
:: Int -> [a] -> Transaction ()
maxTest
:: (Read a, Show a, Eq c, Show c) => String -> (Int -> a -> Dynamic) -> (Int -> a -> b) -> (b -> c) -> Int -> c -> Transaction ()
maxTestUpdate
:: (Read a, Show a, Eq c, Show c) => String -> (Int -> a -> Dynamic) -> (Int -> a -> b) -> (b -> Int) -> (b -> c) -> Int -> b -> Transaction ()
maxTestC
:: (Read a, Show a, Eq c, Show c) => String -> (Int -> a -> Dynamic) -> (Int -> a -> b) -> (b -> c) -> Int -> c -> Transaction ()
minTestC
:: (Read a, Show a, Eq c, Show c) => String -> (Int -> a -> Dynamic) -> (Int -> a -> b) -> (b -> c) -> Int -> c -> Transaction ()
maxTestInsert
:: (Read a, Show a, Eq c, Show c) => String -> (Int -> a -> Dynamic) -> (Int -> a -> b) -> (b -> c) -> Int -> c -> Transaction ()
minTestDelete
:: (Read a, Show a, Eq c, Show c) => String -> (Int -> a -> Dynamic) -> (Int -> a -> b) -> (b -> c) -> Int -> c -> Transaction ()
saveDBTerms
:: (Read a, Show a, Show b) => String -> String -> (Int -> a -> Dynamic) -> (Int -> a -> b) -> IO ()
restoreDBTerms
:: (Read b, Show a) => String -> String -> (Int -> a -> Dynamic) -> (b -> Int) -> (b -> a) -> IO ()
restoreDBRelTerms
:: (Read b, Show a) => String -> String -> (Int -> a -> Dynamic) -> (b -> a) -> IO ()
defaultString
:: String -> String -> String