mirror of
https://github.com/logos-storage/nim-datastore.git
synced 2026-01-04 22:53:08 +00:00
setup query
This commit is contained in:
parent
ca143227c6
commit
7a0c660788
@ -228,20 +228,19 @@ proc queryTask[DB](
|
||||
dq: DbQuery[KeyId]
|
||||
) {.gcsafe, nimcall.} =
|
||||
## run query command
|
||||
if not ctx.setRunning():
|
||||
return
|
||||
|
||||
var qh = ds.query(dq)
|
||||
if qh .isOk():
|
||||
(?!QResult).ok(default(QResult))
|
||||
else:
|
||||
(?!QResult).err(qh.error())
|
||||
var qh: typeof(ds.query(dq))
|
||||
executeTask(ctx):
|
||||
qh = ds.query(dq)
|
||||
if qh.isOk():
|
||||
(?!QResult).ok(default(QResult))
|
||||
else:
|
||||
(?!QResult).err(qh.error())
|
||||
|
||||
var handle = qh.get()
|
||||
|
||||
for item in
|
||||
executeTask(ctx):
|
||||
query(ds, key)
|
||||
for item in handle.iter():
|
||||
executeTask(ctx):
|
||||
item
|
||||
|
||||
method query*(
|
||||
self: ThreadDatastore,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user