File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 180
180
(->XITDBDatabase tldb rwdb (ReentrantLock. )))))
181
181
182
182
183
-
184
183
(deftype XITDBCursor [xdb keypath]
185
184
186
185
java.io.Closeable
194
193
clojure.lang.IAtom
195
194
196
195
(reset [this new-value]
197
- (swap! xdb update-in keypath (constantly new-value)))
196
+ (xitdb- swap-with-lock ! xdb keypath (constantly new-value)))
198
197
199
198
(swap [this f]
200
199
(xitdb-swap-with-lock! xdb keypath f))
208
207
(swap [this f x y args]
209
208
(apply xitdb-swap-with-lock! (concat [xdb keypath f x y] args))))
210
209
211
- (defn xdb-cursor [^XITDBDatabase xdb keypath]
212
- (XITDBCursor. xdb keypath))
210
+ (defn xdb-cursor [xdb keypath]
211
+ (cond
212
+ (instance? XITDBCursor xdb)
213
+ (XITDBCursor. (.-xdb xdb) (vec (concat (.-keypath xdb) keypath)))
214
+
215
+ (instance? XITDBDatabase xdb)
216
+ (XITDBCursor. xdb keypath)
217
+
218
+ :else
219
+ (throw (IllegalArgumentException. (str " xdb must be an instance of XITDBCursor or XITDBDatabase, got: " (type xdb))))))
220
+
221
+
You can’t perform that action at this time.
0 commit comments