# HG changeset patch # User Kim Alvefur # Date 1686507950 -7200 # Node ID 7ebb3d6afcd17a390a4775aa9c2a4675e98807d3 # Parent 9e6ede86d35dac0654bb76e43be09d29f9a7c898 mod_storage_sql: Add some TODO comments for future UPSERT work diff -r 9e6ede86d35d -r 7ebb3d6afcd1 plugins/mod_storage_sql.lua --- 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();