Comparison

plugins/mod_storage_sql.lua @ 13190:9dc6de46dae3

mod_storage_sql: Remove completed TODO (testing UPSERT on PostgreSQL)
author Kim Alvefur <zash@zash.se>
date Wed, 12 Jul 2023 22:51:37 +0200
parent 13159:706f7d1affc2
child 13213:50324f66ca2a
comparison
equal deleted inserted replaced
13189:36b7bdafc993 13190:9dc6de46dae3
215 FROM "prosody" 215 FROM "prosody"
216 WHERE "host"=? AND "user"=? AND "store"=? AND "key"=? 216 WHERE "host"=? AND "user"=? AND "store"=? AND "key"=?
217 LIMIT 1; 217 LIMIT 1;
218 ]]; 218 ]];
219 for key, data in pairs(keydatas) do 219 for key, data in pairs(keydatas) do
220 -- TODO Test UPSERT in PostgreSQL before enabling it.
221 if type(key) == "string" and key ~= "" and engine.params.driver ~= "MySQL" and data ~= self.remove then 220 if type(key) == "string" and key ~= "" and engine.params.driver ~= "MySQL" and data ~= self.remove then
222 local t, value = assert(serialize(data)); 221 local t, value = assert(serialize(data));
223 engine:insert(upsert_sql, host, username or "", self.store, key, t, value, t, value); 222 engine:insert(upsert_sql, host, username or "", self.store, key, t, value, t, value);
224 elseif type(key) == "string" and key ~= "" then 223 elseif type(key) == "string" and key ~= "" then
225 engine:delete(delete_sql, 224 engine:delete(delete_sql,