--- a/plugins/mod_storage_sql.lua Sun Jun 11 20:05:32 2023 +0200
+++ b/plugins/mod_storage_sql.lua Sun Jun 11 20:25:50 2023 +0200
@@ -217,6 +217,7 @@
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 @@
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();