Changeset

13151:7ebb3d6afcd1

mod_storage_sql: Add some TODO comments for future UPSERT work
author Kim Alvefur <zash@zash.se>
date Sun, 11 Jun 2023 20:25:50 +0200
parents 13150:9e6ede86d35d
children 13152:792f360a582b
files plugins/mod_storage_sql.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_storage_sql.lua	Sun Jun 11 20:05:32 2023 +0200
+++ b/plugins/mod_storage_sql.lua	Sun Jun 11 20:25:50 2023 +0200
@@ -217,6 +217,7 @@
 		LIMIT 1;
 		]];
 		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
 				local t, value = assert(serialize(data));
 				engine:insert(upsert_sql, host, username or "", self.store, key, t, value, t, value);
@@ -348,6 +349,7 @@
 		VALUES (?,?,?,?,?,?,?,?);
 		]];
 		if key then
+			-- TODO use UPSERT like map store
 			local result = engine:delete(delete_sql, host, user or "", store, key);
 			if result and item_count then
 				item_count = item_count - result:affected();