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

SQL translator updated

parent fe5f9554
...@@ -6,16 +6,16 @@ import Time ...@@ -6,16 +6,16 @@ import Time
createTestData :: IO () createTestData :: IO ()
createTestData = do createTestData = do
conn <- connectSQLite "Uni.db" conn <- connectSQLite "Uni.db"
result <- ((saveMultipleEntries studentList studentDescription) >+ result <- ((insertEntries studentList studentDescription) >+
(saveMultipleEntries lectureList lectureDescription) >+ (insertEntries lectureList lectureDescription) >+
(saveMultipleEntries lecturerList lecturerDescription) >+ (insertEntries lecturerList lecturerDescription) >+
(saveMultipleEntries placeList placeDescription) >+ (insertEntries placeList placeDescription) >+
(saveMultipleEntries timeList timeDescription) >+ (insertEntries timeList timeDescription) >+
(saveMultipleEntries examList examDescription) >+ (insertEntries examList examDescription) >+
(saveMultipleEntries resultList resultDescription) >+ (insertEntries resultList resultDescription) >+
(saveMultipleEntries participList participationDescription) >+ (insertEntries participList participationDescription) >+
(saveEntryCombined sse1 sseDescription)) (insertEntryCombined sse1 sseDescription)
conn ) conn
case result of case result of
Left (DBError kind str) -> putStrLn ((show kind) ++ " " ++ str) Left (DBError kind str) -> putStrLn ((show kind) ++ " " ++ str)
Right _ -> putStrLn "Ok" Right _ -> putStrLn "Ok"
......
...@@ -645,8 +645,8 @@ transMaybeCond p mModel cond = ...@@ -645,8 +645,8 @@ transMaybeCond p mModel cond =
getInsertfunction :: [[Value]] -> PM (String, String) getInsertfunction :: [[Value]] -> PM (String, String)
getInsertfunction valss = getInsertfunction valss =
if length valss > 1 if length valss > 1
then cleanPM (mCDBI, "saveMultipleEntries") then cleanPM (mCDBI, "insertEntries")
else cleanPM (mCDBI, "saveEntry") else cleanPM (mCDBI, "insertEntry")
-- Translation of list of lists of values. -- Translation of list of lists of values.
transInsertData :: String -> Table -> [ColumnRef] -> [[Value]] -> PM CExpr transInsertData :: String -> Table -> [ColumnRef] -> [[Value]] -> PM CExpr
......
Supports Markdown
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