We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ea69d1 commit c17b575Copy full SHA for c17b575
src/compute/datomic_client_memdb/core.clj
@@ -7,6 +7,9 @@
7
8
(defonce clients (atom {}))
9
10
+(defn update-vals [m ks f]
11
+ (reduce #(update-in % [%2] f) m ks))
12
+
13
(defn- throw-unsupported
14
[data]
15
(throw (ex-info "Unsupported operation." data)))
@@ -61,7 +64,8 @@
61
64
(LocalDb. (peer/db conn) db-name))
62
65
63
66
(transact [_ arg-map]
- @(peer/transact conn (:tx-data arg-map)))
67
+ (-> @(peer/transact conn (:tx-data arg-map))
68
+ (update-vals #{:db-before :db-after} #(LocalDb. % db-name))))
69
70
(tx-range [_ arg-map]
71
(peer/tx-range (peer/log conn) (:start arg-map) (:end arg-map)))
@@ -116,4 +120,4 @@
116
120
(let [new-client (map->Client {:db-lookup (atom {})
117
121
:client-arg-map arg-map})]
118
122
(swap! clients assoc arg-map new-client)
119
- new-client)))
123
+ new-client)))
0 commit comments