From 23273ed228afad60d1ba4f69af9bcd21d1b8165d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 11 Jun 2023 20:25:50 +0200 Subject: mod_storage_sql: Add some TODO comments for future UPSERT work --- plugins/mod_storage_sql.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins/mod_storage_sql.lua') diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua index 8ea05c4c..06581d16 100644 --- a/plugins/mod_storage_sql.lua +++ b/plugins/mod_storage_sql.lua @@ -217,6 +217,7 @@ function map_store:set_keys(username, keydatas) LIMIT 1; ]]; for key, data in pairs(keydatas) do + -- TODO Test UPSERT in PostgreSQL before enabling it. if type(key) == "string" and key ~= "" and engine.params.driver == "SQLite3" and data ~= self.remove then local t, value = assert(serialize(data)); engine:insert(upsert_sql, host, username or "", self.store, key, t, value, t, value); @@ -348,6 +349,7 @@ function archive_store:append(username, key, value, when, with) VALUES (?,?,?,?,?,?,?,?); ]]; if key then + -- TODO use UPSERT like map store local result = engine:delete(delete_sql, host, user or "", store, key); if result and item_count then item_count = item_count - result:affected(); -- cgit v1.2.3