Commit 41e2535a authored by Michael Hanus's avatar Michael Hanus
Browse files

SQL translator updated

parent fe5f9554
......@@ -6,16 +6,16 @@ import Time
createTestData :: IO ()
createTestData = do
conn <- connectSQLite "Uni.db"
result <- ((saveMultipleEntries studentList studentDescription) >+
(saveMultipleEntries lectureList lectureDescription) >+
(saveMultipleEntries lecturerList lecturerDescription) >+
(saveMultipleEntries placeList placeDescription) >+
(saveMultipleEntries timeList timeDescription) >+
(saveMultipleEntries examList examDescription) >+
(saveMultipleEntries resultList resultDescription) >+
(saveMultipleEntries participList participationDescription) >+
(saveEntryCombined sse1 sseDescription))
conn
result <- ((insertEntries studentList studentDescription) >+
(insertEntries lectureList lectureDescription) >+
(insertEntries lecturerList lecturerDescription) >+
(insertEntries placeList placeDescription) >+
(insertEntries timeList timeDescription) >+
(insertEntries examList examDescription) >+
(insertEntries resultList resultDescription) >+
(insertEntries participList participationDescription) >+
(insertEntryCombined sse1 sseDescription)
) conn
case result of
Left (DBError kind str) -> putStrLn ((show kind) ++ " " ++ str)
Right _ -> putStrLn "Ok"
......
......@@ -645,8 +645,8 @@ transMaybeCond p mModel cond =
getInsertfunction :: [[Value]] -> PM (String, String)
getInsertfunction valss =
if length valss > 1
then cleanPM (mCDBI, "saveMultipleEntries")
else cleanPM (mCDBI, "saveEntry")
then cleanPM (mCDBI, "insertEntries")
else cleanPM (mCDBI, "insertEntry")
-- Translation of list of lists of values.
transInsertData :: String -> Table -> [ColumnRef] -> [[Value]] -> PM CExpr
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment