Diff

plugins/mod_storage_sql.lua @ 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
parent 13213:50324f66ca2a
child 13222:cb6a17eaa0e6
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 = [[