We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0bea377 commit 479cb0eCopy full SHA for 479cb0e
src/xitdb/db.clj
@@ -122,6 +122,13 @@
122
[xdb]
123
(.count (read-history (-> xdb .tldbro .get))))
124
125
+(defn deref-at
126
+ "Returns the version of the data at the specified index."
127
+ [xdb index]
128
+ (let [history (read-history (-> xdb .tldbro .get))
129
+ cursor (.getCursor history index)]
130
+ (xtypes/read-from-cursor cursor false)))
131
+
132
(deftype XITDBDatabase [tldbro rwdb lock]
133
134
java.io.Closeable
@@ -131,9 +138,7 @@
138
139
clojure.lang.IDeref
140
(deref [this]
- (let [history (read-history (.get tldbro))
135
- cursor (.getCursor history -1)]
136
- (xtypes/read-from-cursor cursor false)))
141
+ (deref-at this -1))
137
142
143
clojure.lang.IAtom
144
0 commit comments