Last active
March 12, 2016 14:37
-
-
Save benkamphaus/7eaa6484a254a14f8f1f to your computer and use it in GitHub Desktop.
Look up a transaction by its uuid (will match uuid in logs)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[datomic.api :as d]) | |
(defn tx-maps [log start] | |
(into [] (map #(into {} %) (d/tx-range log start nil)))) | |
(defn txid-match? [uuid] | |
(fn [tx-map] | |
(= uuid (:id tx-map)))) | |
(defn lookup-tx [log uuid-val] | |
(let [txes (tx-maps log nil) | |
(filter (txid-match? uuid-val) txes))) | |
(comment | |
(d/connect "YOUR-URI-HERE") | |
(lookup-tx (d/log conn) #uuid "54a6c755-4624-4aa3-807f-16e99d8dd199") | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment