kv
scan
Scan KV rows with values and version facts.
strata kv scandb.kv.scan(start: 'Optional[str | bytes]' = None, *, limit: 'Optional[int]' = None, cursor: 'Optional[Any]' = None) -> 'Page'wire kv_scan
Scans visible KV rows starting at an optional key. Each item includes the key, value, and commit metadata exposed by the executor output.
Paginated responses use opaque cursors. Clients should pass the returned cursor back to the same command shape and must not parse cursor contents.
To see the complete help for this command, run:
strata kv scan --helphelp(db.kv.scan)
Example
Scan full rows from the start, in key order.
strata kv put a 1strata kv put b 2strata kv scan
_ = db.kv.put("a", "1")_ = db.kv.put("b", "2")[row.key for row in db.kv.scan()]
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| branch | string or null | no | Target branch. Defaults to the executor handle branch. |
| limit | integer or null | no | Optional row limit. |
| space | string or null | no | Target product space. Defaults to `"default"`. |
| start | any | no | Optional inclusive start key. |
Returns
Page<ScanItem, Bytes>
- dataobject
Shared pagination continuation facts.
- typestring
Errors
Recover by code. Retry policy and commit outcome come from the shipped error registry.
| Code | Retry | Commit outcome |
|---|---|---|
| failed_precondition.engine.runtime_closed | never | not_started |
| not_found.engine.branch | never | not_applicable |
| invalid_argument.engine.product_space | never | not_started |
| invalid_argument.engine.kv_key | never | not_started |