Skip to content

Instantly share code, notes, and snippets.

@jdubie
Created December 1, 2015 17:56
Show Gist options
  • Save jdubie/e7682a9c5cf7d5ecb60f to your computer and use it in GitHub Desktop.
Save jdubie/e7682a9c5cf7d5ecb60f to your computer and use it in GitHub Desktop.
datomic question about the `d/db` function
(ns datomic.example
(:require [datomic.api :as d]))
;; question about the function `d/db`
;;
;; in `example` pull `d/pull` always see the transaction that commits [:db/add id :foo :bar]?
(defn example
[conn id]
(do @(d/transact conn [{:db/id id :foo :bar}])
(d/pull (d/db conn) '[*] id)))
(defn exmaple'
[conn id]
(let [{:keys [db-after]} @(d/transact conn [{:db/id id :foo :bar}])]
(d/pull db-after '[*] id)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment