Line data Source code
1 4 : (ns matchscore.telegram.changelog
2 : (:require
3 : [honey.sql :as sql]
4 : [matchscore.utils.db :as utils.db]
5 : [next.jdbc :as jdbc]))
6 :
7 :
8 4 : (defn find-for-event
9 : "Full durable history, oldest first. Membership changes are captured transactionally
10 : in PostgreSQL, for both app and Telegram actions. Names are snapshots."
11 : [pg event-id]
12 4 : (mapv
13 2 : utils.db/unqualify-keys
14 4 : (jdbc/execute!
15 2 : pg
16 4 : (sql/format
17 14 : {:select [:*]
18 4 : :from [:event_participant_changes]
19 14 : :where [:= :event-id [:cast event-id :uuid]]
20 14 : :order-by [[:created-datetime :asc] [:uuid :asc]]}))))
|