definition: |
genSaveDB :: String -> [Entity] -> [CFuncDecl] genSaveDB mname ents = [ stCmtFunc ("Saves complete database as term files into an existing directory\n" ++ "provided as a parameter.") (mname,"saveDBTo") 1 Public (stringType ~> ioType unitType) [simpleRule [cpvar "dir"] (CDoExpr (map saveDBTerms ents))] , stCmtFunc ("Restores complete database from term files which are stored\n" ++ "in a directory provided as a parameter.") (mname,"restoreDBFrom") 1 Public (stringType ~> ioType unitType) [simpleRule [cpvar "dir"] (CDoExpr (map restoreDBTerms ents))] ] where saveDBTerms (Entity name _) = CSExpr $ applyF (mER,"saveDBTerms") [ constF (mname, firstLow name ++ "_CDBI_Description") , constF (mname,"sqliteDBFile") , cvar "dir"] restoreDBTerms (Entity name _) = CSExpr $ applyF (mER,"restoreDBTerms") [ constF (mname, firstLow name ++ "_CDBI_Description") , constF (mname,"sqliteDBFile") , cvar "dir"] |
demand: |
no demanded arguments |
deterministic: |
deterministic operation |
documentation: |
-- Generates operations to save and restore the complete database. |
failfree: |
(_, _) |
indeterministic: |
referentially transparent operation |
infix: |
no fixity defined |
iotype: |
{(_,_) |-> {:}} |
name: |
genSaveDB |
precedence: |
no precedence defined |
result-values: |
{:} |
signature: |
String -> [Database.ERD.Entity] -> [AbstractCurry.Types.CFuncDecl] |
solution-complete: |
operation might suspend on free variables |
terminating: |
possibly non-terminating |
totally-defined: |
possibly non-reducible on same data term |