Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cdbi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
curry-packages
cdbi
Commits
1e4364f4
Commit
1e4364f4
authored
1 year ago
by
Michael Hanus
Browse files
Options
Downloads
Patches
Plain Diff
Remove output in `save/restoreDBTerms` so that it can also invoked in web scripts
parent
7cb3ac4b
Branches
master
Tags
v3.2.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Database/CDBI/ER.curry
+5
-5
5 additions, 5 deletions
src/Database/CDBI/ER.curry
with
5 additions
and
5 deletions
src/Database/CDBI/ER.curry
+
5
−
5
View file @
1e4364f4
...
...
@@ -590,10 +590,10 @@ saveDBTerms endescr dbname path = do
let savefile = path </> getTable endescr ++ ".terms"
showentries = unlines (map show allentries)
if null path
then putStrLn showentries -- show only
else do putStr $ "Saving into '" ++ savefile ++ "'..."
then putStrLn showentries -- show only
when the is empty
else do
--
putStr $ "Saving into '" ++ savefile ++ "'..."
writeFile savefile showentries
putStrLn "done"
--
putStrLn "done"
--- Restores entries saved in a term file by deleting all existing entries
--- and inserting the saved entries.
...
...
@@ -603,13 +603,13 @@ saveDBTerms endescr dbname path = do
restoreDBTerms :: Read a => EntityDescription a -> String -> String -> IO ()
restoreDBTerms endescr dbname path = do
let savefile = path </> getTable endescr ++ ".terms"
putStr $ "Restoring from '" ++ savefile ++ "'..."
--
putStr $ "Restoring from '" ++ savefile ++ "'..."
entries <- readFile savefile >>= return . map read . lines
runJustTransactionOnDB dbname $ do
setForeignKeyCheck False
deleteEntries endescr Nothing
restoreEntries endescr entries
putStrLn "done"
--
putStrLn "done"
--- Executes a DB action on a database and returns the result.
--- An error is raised if the DB action produces an error.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment