definition:
|
restoreDBTerms :: Read a => EntityDescription a -> String -> String -> IO ()
restoreDBTerms endescr dbname path = do
let savefile = path </> getTable endescr ++ ".terms"
--putStr $ "Restoring from '" ++ savefile ++ "'..."
entries <- readFile savefile >>= return . map read . lines
runJustTransactionOnDB dbname $ do
setForeignKeyCheck False
deleteEntries endescr Nothing
restoreEntries endescr entries
|
demand:
|
no demanded arguments
|
deterministic:
|
deterministic operation
|
documentation:
|
--- Restores entries saved in a term file by deleting all existing entries
--- and inserting the saved entries.
--- @param endescr - the EntityDescription of the entities to be restored
--- @param dbname - name of the database (e.g. "database.db")
--- @param path - directory where term file was saved
|
failfree:
|
<FAILING>
|
indeterministic:
|
referentially transparent operation
|
infix:
|
no fixity defined
|
iotype:
|
{(_,_,_,_) |-> _}
|
name:
|
restoreDBTerms
|
precedence:
|
no precedence defined
|
result-values:
|
_
|
signature:
|
Prelude.Read a => Database.CDBI.Description.EntityDescription a -> String
-> String -> Prelude.IO ()
|
solution-complete:
|
operation might suspend on free variables
|
terminating:
|
possibly non-terminating
|
totally-defined:
|
possibly non-reducible on same data term
|