Software /
code /
prosody
Changeset
13221:2a9ce229efac
mod_storage_sql: Allow higher precision timestamps in SQLite3
Since it doesn't actually do strict typing :)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 17 Jul 2023 04:52:50 +0200 |
parents | 13220:56decf85db1d |
children | 13222:cb6a17eaa0e6 |
files | plugins/mod_storage_sql.lua |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_storage_sql.lua Mon Jul 17 14:57:27 2023 +0200 +++ b/plugins/mod_storage_sql.lua Mon Jul 17 04:52:50 2023 +0200 @@ -335,7 +335,11 @@ end -- FIXME update the schema to allow precision timestamps - when = when and math.floor(when) or os.time(); + when = when or os.time(); + if engine.params.driver ~= "SQLite3" then + -- SQLite3 doesn't enforce types :) + when = math.floor(when); + end with = with or ""; local ok, ret = engine:transaction(function() local delete_sql = [[