diff options
author | Kim Alvefur <zash@zash.se> | 2023-06-11 20:25:50 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2023-06-11 20:25:50 +0200 |
commit | 23273ed228afad60d1ba4f69af9bcd21d1b8165d (patch) | |
tree | 8b5129f1052e36e5206299dd429070120db30a76 /plugins | |
parent | 3efb1a72e7c85434bebbc3c3d72aa4008a4424ca (diff) | |
download | prosody-23273ed228afad60d1ba4f69af9bcd21d1b8165d.tar.gz prosody-23273ed228afad60d1ba4f69af9bcd21d1b8165d.zip |
mod_storage_sql: Add some TODO comments for future UPSERT work
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_storage_sql.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua index 8ea05c4c..06581d16 100644 --- a/plugins/mod_storage_sql.lua +++ b/plugins/mod_storage_sql.lua @@ -217,6 +217,7 @@ function map_store:set_keys(username, keydatas) 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 @@ function archive_store:append(username, key, value, when, with) 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(); |