# HG changeset patch # User Kim Alvefur # Date 1686913414 -7200 # Node ID 6cf5c215825de6bf4bb47b0c2fc638ab2ceb7f54 # Parent 88879f83b5b4f1bd7d29623de2975f82b35dff77 mod_storage_sql: Enable UPSERT with PostgreSQL Tested. Works. diff -r 88879f83b5b4 -r 6cf5c215825d plugins/mod_storage_sql.lua --- 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