Small SQL typos

This commit is contained in:
Stephane Bortzmeyer 2024-06-18 16:42:17 +02:00
parent 7a527cc06c
commit 8746a28bf4
2 changed files with 4 additions and 4 deletions

View File

@ -11,8 +11,8 @@ escape = concatMap fixChar
maybeToPostgreSQL Nothing = "NULL"
maybeToPostgreSQL (Just s) = "'" ++ (escape s) ++ "'"
maybeListToPostgreSQL Nothing = ""
maybeListToPostgreSQL (Just s) = "'" ++ (foldr (++) "" s) ++ "'"
maybeListToPostgreSQL Nothing = "NULL"
maybeListToPostgreSQL (Just s) = "'" ++ (foldr (++) "" (map escape s)) ++ "'"
onedescrToPostgreSQL "language" i s = "INSERT INTO Descriptions (description) " ++
" VALUES ('" ++ (escape s) ++ "');\n" ++

View File

@ -11,8 +11,8 @@ escape = concatMap fixChar
maybeToSQLite Nothing = "NULL"
maybeToSQLite (Just s) = "'" ++ (escape s) ++ "'"
maybeListToSQLite Nothing = ""
maybeListToSQLite (Just s) = "'" ++ (foldr (++) "" s) ++ "'"
maybeListToSQLite Nothing = "NULL"
maybeListToSQLite (Just s) = "'" ++ (foldr (++) "" (map escape s)) ++ "'"
-- TODO: use "SELECT last_insert_rowid();" is probably cleaner than
-- "SELECT max(oid)"