From b2cc309529ce43511af3c7a02922a7451dea7e13 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 16 Jun 2023 13:03:34 +0200 Subject: mod_storage_sql: Enable UPSERT with PostgreSQL Tested. Works. --- plugins/mod_storage_sql.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua index 06581d16..bf97791c 100644 --- a/plugins/mod_storage_sql.lua +++ b/plugins/mod_storage_sql.lua @@ -218,7 +218,7 @@ function map_store:set_keys(username, keydatas) ]]; 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 -- cgit v1.2.3