From e239a5d41eca91759e03eb86e10e4ef8385e4927 Mon Sep 17 00:00:00 2001 From: ImBenji Date: Mon, 17 Aug 2026 13:56:13 +0100 Subject: [PATCH] fix: cast postgres archive timestamps --- src/db/runtime.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/db/runtime.js b/src/db/runtime.js index 7bb7978..78a49a0 100644 --- a/src/db/runtime.js +++ b/src/db/runtime.js @@ -69,6 +69,7 @@ function rewriteSql(sql, params) { text = text.replace(/datetime\('now',\s*'([^']+)'\)/gi, "CURRENT_TIMESTAMP + interval '$1'"); text = text.replace(/datetime\('now'\)/gi, 'CURRENT_TIMESTAMP'); text = text.replace(/date\('now'\)/gi, 'CURRENT_DATE'); + text = text.replace(/\bingested_at\s*>=\s*CURRENT_TIMESTAMP/gi, 'ingested_at::timestamp >= CURRENT_TIMESTAMP'); text = text.replace(/datetime\(COALESCE\(([^)]+)\)\)/gi, 'COALESCE($1)::timestamp'); text = text.replace(/datetime\((p\.information_cutoff),\s*'\+'\s*\|\|\s*(p\.horizon_days)\s*\|\|\s*' days'\)/gi, "($1::timestamp + ($2 || ' days')::interval)"); text = text.replace(/datetime\(([^)]+)\)/gi, '($1)::timestamp');