mirror of
https://github.com/logos-storage/nim-datastore.git
synced 2026-01-05 23:23:10 +00:00
initial take at making fsds synchronous
This commit is contained in:
parent
bb9e343e9f
commit
235232a84f
@ -184,7 +184,8 @@ proc query*(
|
|||||||
self: FSDatastore,
|
self: FSDatastore,
|
||||||
query: DbQuery[KeyId]): ?!QueryIter =
|
query: DbQuery[KeyId]): ?!QueryIter =
|
||||||
|
|
||||||
without path =? self.path(query.key), error:
|
let key = query.key.toKey()
|
||||||
|
without path =? self.path(key), error:
|
||||||
return failure error
|
return failure error
|
||||||
|
|
||||||
let basePath =
|
let basePath =
|
||||||
@ -236,7 +237,7 @@ proc query*(
|
|||||||
key = Key.init(keyPath).expect("should not fail")
|
key = Key.init(keyPath).expect("should not fail")
|
||||||
data =
|
data =
|
||||||
if query.value:
|
if query.value:
|
||||||
self.readFile[DataBuffer]((basePath / path).absolutePath)
|
readFile[DataBuffer](self, (basePath / path).absolutePath)
|
||||||
.expect("Should read file")
|
.expect("Should read file")
|
||||||
else:
|
else:
|
||||||
@[]
|
@[]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user