partway through transaction rules

This commit is contained in:
Bryce Covert
2020-08-24 20:54:51 -07:00
parent 84137161bf
commit ace220672d
21 changed files with 118 additions and 105 deletions

View File

@@ -367,3 +367,19 @@
(require '[mount.core :as mount])
(require '[auto-ap.server])
(mount/start-without #'auto-ap.server/jetty))
(defn entity-history [i]
(vec (sort-by first (d/query
{:query {:find ['?tx '?z '?v ]
:in ['?i '$]
:where ['[?i ?a ?v ?tx ?ad]
'[?a :db/ident ?z]
'[(= ?ad true)]]}
:args [i (d/history (d/db (d/connect uri)))]}))))
(defn tx-detail [i]
(map (juxt :e #(d/ident (d/db (d/connect uri)) (:a %)) :v)
(:data (first
(d/tx-range (d/log (d/connect uri))
i
(inc i))))))