From 8746a28bf47498df9f117dd7ed46d4c32c404d39 Mon Sep 17 00:00:00 2001 From: Stephane Bortzmeyer Date: Tue, 18 Jun 2024 16:42:17 +0200 Subject: [PATCH] Small SQL typos --- Registry/Utils/PostgreSQL.hs | 4 ++-- Registry/Utils/SQLite.hs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Registry/Utils/PostgreSQL.hs b/Registry/Utils/PostgreSQL.hs index 7783bea..93f423a 100644 --- a/Registry/Utils/PostgreSQL.hs +++ b/Registry/Utils/PostgreSQL.hs @@ -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" ++ diff --git a/Registry/Utils/SQLite.hs b/Registry/Utils/SQLite.hs index 8c070c2..d2f7a07 100644 --- a/Registry/Utils/SQLite.hs +++ b/Registry/Utils/SQLite.hs @@ -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)"