Software / code / prosody
Diff
plugins/mod_storage_sql.lua @ 13318:4a437dd62cc9
mod_storage_sql: Use UUIDv7 as keys
Potentially allows sorting on those directly as they will be in
increasing order.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 17 Jul 2023 04:30:35 +0200 |
| parent | 13242:0d3881bf29a8 |
| child | 13611:3a23116cf063 |
line wrap: on
line diff
--- a/plugins/mod_storage_sql.lua Sun Aug 15 14:44:21 2021 +0200 +++ b/plugins/mod_storage_sql.lua Mon Jul 17 04:30:35 2023 +0200 @@ -366,7 +366,7 @@ item_count = item_count - result:affected(); end else - key = uuid.generate(); + key = uuid.v7(); end local t, encoded_value = assert(serialize(value)); engine:insert(insert_sql, host, user or "", store, when, with, key, t, encoded_value);