event
range
Read a range of events by sequence number.
strata event rangedb.events.range(start: 'int', *, end: 'Optional[int]' = None, limit: 'Optional[int]' = None, reverse: 'bool' = False, event_type: 'Optional[str]' = None) -> 'Page'wire event_range
Reads events from the selected branch and space by sequence range. The start sequence is inclusive and the optional end sequence is exclusive; reverse direction returns the same `[start_seq, end_seq)` window in descending order (newest first). An optional event type narrows the results.
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 event range --helphelp(db.events.range)
Example
Read a range of events by sequence.
strata event append user.created {"id":1}strata event append user.updated {"id":2}strata event range 0 --direction forward
_ = db.events.append("user.created", {"id": 1})_ = db.events.append("user.updated", {"id": 2})[e.event.payload for e in db.events.range(0)]
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| direction | EventRangeDirection | yes | Result ordering.one of: forward, reverse |
| start_seq | integer | yes | Inclusive lower bound of the sequence window (same in both directions). |
| branch | string or null | no | Target branch. Defaults to the executor handle branch. |
| end_seq | integer or null | no | Optional exclusive upper bound of the sequence window (same in both directions). |
| event_type | string or null | no | Optional event type filter. |
| limit | integer or null | no | Optional item limit. |
| space | string or null | no | Target product space. Defaults to `"default"`. |
Returns
Page<EventVersionedData, u64>
- 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.event_type | never | not_started |
| invalid_argument.executor.limit | never | not_started |