Add label and id support for debug snapshot helpers

This commit is contained in:
Andrey Antukh 2024-08-27 15:14:40 +02:00
parent 2643dae0a7
commit 569674452a
3 changed files with 21 additions and 14 deletions

View file

@ -41,8 +41,8 @@
FROM file_change
WHERE file_id = ?
AND created_at < ?
AND label is not null
ORDER BY created_at desc
AND label IS NOT NULL
ORDER BY created_at DESC
LIMIT ?")
(defn get-file-snapshots
@ -50,7 +50,6 @@
:or {limit Long/MAX_VALUE}}]
(let [start-at (or start-at (dt/now))
limit (min limit 20)]
(->> (db/exec! conn [sql:get-file-snapshots file-id start-at limit])
(mapv (fn [row]
(update row :created-at dt/format-instant :rfc1123))))))