From e34558412ae4b45e99d5efc25e0d9a47a97e1669 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Wed, 8 Jul 2020 13:01:06 -0400 Subject: Convert timestamps to unix epoch time This saves 125 MB on my own database after VACUUM. --- unscoop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'unscoop.c') diff --git a/unscoop.c b/unscoop.c index 4392816..033c1dd 100644 --- a/unscoop.c +++ b/unscoop.c @@ -263,8 +263,8 @@ static void prepareInsert(void) { SELECT // SQLite expects a colon in the timezine, but ISO8601 does not. CASE WHEN :time LIKE '%Z' - THEN datetime(:time) - ELSE datetime(substr(:time, 1, 22) || ':' || substr(:time, -2)) + THEN strftime('%s', :time) + ELSE strftime('%s', substr(:time, 1, 22) || ':' || substr(:time, -2)) END, :type, context, names.name, :target, :message FROM contexts, names -- cgit 1.4.1