From e1b3be001563903640f869a93392fd452aa9fb16 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 17 Jul 2023 04:52:50 +0200 Subject: mod_storage_sql: Allow higher precision timestamps in SQLite3 Since it doesn't actually do strict typing :) --- plugins/mod_storage_sql.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua index 3768b6b2..fe7d2ef0 100644 --- a/plugins/mod_storage_sql.lua +++ b/plugins/mod_storage_sql.lua @@ -335,7 +335,11 @@ function archive_store:append(username, key, value, when, with) 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 = [[ -- cgit v1.2.3