Created
December 1, 2015 17:56
-
-
Save jdubie/e7682a9c5cf7d5ecb60f to your computer and use it in GitHub Desktop.
datomic question about the `d/db` function
This file contains hidden or 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
(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