mirror of
https://github.com/logos-storage/nim-datastore.git
synced 2026-01-02 21:53:05 +00:00
databuffer type
This commit is contained in:
parent
8b4f388bb3
commit
8800a2ccc0
@ -10,7 +10,7 @@ import ./key
|
||||
import ./types
|
||||
|
||||
export databuffer, threadresult, semaphore, types
|
||||
export upraises, results
|
||||
export upraises, results, SortOrder
|
||||
|
||||
type
|
||||
KeyId* = object
|
||||
@ -29,7 +29,7 @@ type
|
||||
offset*: int # Offset from which to start querying - not available in all backends
|
||||
sort*: SortOrder # Sort order - not available in all backends
|
||||
|
||||
DbQueryResponse* = tuple[key: Option[string], data: seq[byte]] | tuple[key: Option[KeyId], data: DataBuffer]
|
||||
DbQueryResponse* = tuple[key: Option[KeyId], val: DataBuffer]
|
||||
|
||||
proc `$`*(id: KeyId): string = $(id.data)
|
||||
|
||||
|
||||
@ -104,11 +104,10 @@ proc close*(self: SQLiteDatastore): ?!void =
|
||||
|
||||
|
||||
iterator query*(self: SQLiteDatastore,
|
||||
query: Query
|
||||
): ?!ThreadQueryRes =
|
||||
query: DbQuery
|
||||
): ?!DbQueryResponse {.closure.} =
|
||||
|
||||
var
|
||||
iter = QueryIter()
|
||||
queryStr = if query.value:
|
||||
QueryStmtDataIdStr
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user