Changeset

13154:6cf5c215825d

mod_storage_sql: Enable UPSERT with PostgreSQL Tested. Works.
author Kim Alvefur <zash@zash.se>
date Fri, 16 Jun 2023 13:03:34 +0200
parents 13153:88879f83b5b4
children 13155:9a7523ea45cb
files plugins/mod_storage_sql.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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