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 Nothing = "NULL"
maybeToPostgreSQL (Just s) = "'" ++ (escape s) ++ "'" maybeToPostgreSQL (Just s) = "'" ++ (escape s) ++ "'"
maybeListToPostgreSQL Nothing = "" maybeListToPostgreSQL Nothing = "NULL"
maybeListToPostgreSQL (Just s) = "'" ++ (foldr (++) "" s) ++ "'" maybeListToPostgreSQL (Just s) = "'" ++ (foldr (++) "" (map escape s)) ++ "'"
onedescrToPostgreSQL "language" i s = "INSERT INTO Descriptions (description) " ++ onedescrToPostgreSQL "language" i s = "INSERT INTO Descriptions (description) " ++
" VALUES ('" ++ (escape s) ++ "');\n" ++ " VALUES ('" ++ (escape s) ++ "');\n" ++

View File

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