mirror of
https://github.com/logos-storage/nim-datastore.git
synced 2026-01-02 13:43:11 +00:00
refactor - tests
This commit is contained in:
parent
ade0898fe7
commit
cac5d52b35
@ -51,8 +51,9 @@ proc dbQuery*[K](
|
||||
|
||||
proc `$`*(id: KeyId): string = $(id.data)
|
||||
|
||||
proc toKey*(tp: typedesc[KeyId], id: cstring): KeyId = KeyId.new(id)
|
||||
proc toKey*(tp: typedesc[string], id: cstring): string = $(id)
|
||||
proc toKey*(tp: typedesc[KeyId], id: string|cstring): KeyId = KeyId.new($id)
|
||||
proc toKey*(tp: typedesc[string], id: string|cstring): string = $(id)
|
||||
# proc toKey*(tp: typedesc[Key], id: string|cstring): KeyId = Key.init($id).expect("valid key")
|
||||
|
||||
template toVal*(tp: typedesc[DataBuffer], id: openArray[byte]): DataBuffer = DataBuffer.new(id)
|
||||
template toVal*(tp: typedesc[seq[byte]], id: openArray[byte]): seq[byte] = @(id)
|
||||
|
||||
@ -204,8 +204,9 @@ proc query*[K,V](
|
||||
let env = FsQueryEnv[K,V](self: self, basePath: DataBuffer.new(basePath))
|
||||
success DbQueryHandle[KeyId, V, FsQueryEnv[K,V]](query: query, env: env)
|
||||
|
||||
iterator iter*[K, V](handle: var DbQueryHandle[K, V, FsQueryEnv[K,V]]): ?!DbQueryResponse[K, V] =
|
||||
let root = $(handle.env)
|
||||
iterator iter*[K, V](handle: var DbQueryHandle[K, V, FsQueryEnv[K,V]]
|
||||
): ?!DbQueryResponse[K, V] =
|
||||
let root = $(handle.env.self.root)
|
||||
echo "FS:root: ", root
|
||||
|
||||
for path in root.dirIter():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user