databuffer type

This commit is contained in:
Jaremy Creechley 2023-09-20 20:31:42 -07:00
parent 8b4f388bb3
commit 8800a2ccc0
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300
2 changed files with 4 additions and 5 deletions

View File

@ -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)

View File

@ -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: