Software /
code /
prosody
Diff
plugins/mod_storage_sql.lua @ 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 |
parent | 13150:9e6ede86d35d |
child | 13154:6cf5c215825d |
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();