mod_storage_sql: Enable UPSERT with PostgreSQL
Tested. Works.
--- a/plugins/mod_storage_sql.lua Fri Jun 16 13:02:35 2023 +0200
+++ b/plugins/mod_storage_sql.lua Fri Jun 16 13:03:34 2023 +0200
@@ -218,7 +218,7 @@
]];
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
+ if type(key) == "string" and key ~= "" and engine.params.driver ~= "MySQL" 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);
elseif type(key) == "string" and key ~= "" then