mirror of
https://github.com/logos-storage/nim-datastore.git
synced 2026-01-05 23:23:10 +00:00
update fsds
This commit is contained in:
parent
131712071f
commit
bda61df77e
@ -176,12 +176,12 @@ proc close*(self: FSDatastore): ?!void =
|
|||||||
return success()
|
return success()
|
||||||
|
|
||||||
type
|
type
|
||||||
FsQueryEnv* = tuple[basePath: DataBuffer, self: FSDatastore]
|
FsQueryEnv* = tuple[self: FSDatastore, basePath: DataBuffer]
|
||||||
|
|
||||||
proc query*(
|
proc query*(
|
||||||
self: FSDatastore,
|
self: FSDatastore,
|
||||||
query: DbQuery[KeyId],
|
query: DbQuery[KeyId],
|
||||||
): Result[DbQueryHandle[KeyId, DataBuffer, KeyId], ref CatchableError] =
|
): Result[DbQueryHandle[KeyId, DataBuffer, FsQueryEnv], ref CatchableError] =
|
||||||
|
|
||||||
let key = query.key.toKey()
|
let key = query.key.toKey()
|
||||||
without path =? self.findPath(key), error:
|
without path =? self.findPath(key), error:
|
||||||
@ -196,6 +196,9 @@ proc query*(
|
|||||||
path.parentDir
|
path.parentDir
|
||||||
else:
|
else:
|
||||||
path.changeFileExt("")
|
path.changeFileExt("")
|
||||||
|
|
||||||
|
let env: FsQueryEnv = (self: self, basePath: DataBuffer.new(basePath))
|
||||||
|
success DbQueryHandle[KeyId, DataBuffer, FsQueryEnv](env: env)
|
||||||
|
|
||||||
iterator iter*[K, V](handle: var DbQueryHandle[K, V, DataBuffer]): ?!DbQueryResponse[K, V] =
|
iterator iter*[K, V](handle: var DbQueryHandle[K, V, DataBuffer]): ?!DbQueryResponse[K, V] =
|
||||||
let root = $(handle.env)
|
let root = $(handle.env)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user