definition:
|
erd2code :: Option -> ERD -> CurryProg
erd2code opt@(_, consistencyTest) (ERD n es rs) =
CurryProg n
imports Nothing [] []
(concatMap (entity2datatype opt n) entities
++ map (entity2datatypeKey opt n) entities
++ concatMap (generatedEntity2datatype opt n) generatedEntities)
(generateStorageDefinition opt n
++ concatMap (entity2trans opt n) entities
++ concatMap (generatedEntity2trans opt n) generatedEntities
++ concatMap (entity2selmod opt n) es
++ concatMap (entity2DBcode opt n entities es rs) entities
++ concatMap (generatedEntity2DBcode opt n rs) generatedEntities
++ concatMap (rel2code opt n es) rs
++ (case consistencyTest of
WithConsistencyTest ->
[checkAll n es]
++ (map (\e -> checkEntity n e) es)
++ (map (\e -> checkEntry n e es rs) es)
WithoutConsistencyTest -> [])
++ [saveAll n entities generatedEntities,
restoreAll n entities generatedEntities])
[]
where
imports = "Database.ERD.Generic" : keyDatabaseMod :
sort (concatMap getImports es)
entities = filter (not . isGenerated) es
generatedEntities = filter isGenerated es
|
demand:
|
arguments 1 2
|
deterministic:
|
deterministic operation
|
failfree:
|
<FAILING>
|
indeterministic:
|
referentially transparent operation
|
infix:
|
no fixity defined
|
iotype:
|
{({(,)},{ERD}) |-> {CurryProg}}
|
name:
|
erd2code
|
precedence:
|
no precedence defined
|
result-values:
|
{CurryProg}
|
signature:
|
(Storage, ConsistencyTest) -> Database.ERD.ERD -> AbstractCurry.Types.CurryProg
|
solution-complete:
|
operation might suspend on free variables
|
terminating:
|
possibly non-terminating
|
totally-defined:
|
possibly non-reducible on same data term
|