event
range_time
Read a range of events by occurrence time.
strata event range-timedb.events.range_by_time(start_ts: 'int', *, end_ts: 'Optional[int]' = None, limit: 'Optional[int]' = None, reverse: 'bool' = False, event_type: 'Optional[str]' = None) -> 'Page'wire event_range_by_time
Reads events from the selected branch and space whose append timestamps fall inside a half-open `[start_ts, end_ts)` microsecond window - the start is inclusive and the end is exclusive, matching the sequence-addressed range. This queries when events occurred; historical log states are the timestamped read commands' job. 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-time --helphelp(db.events.range_by_time)
Example
Read a range of events by timestamp.
strata event append user.created {"id":1}strata event append user.updated {"id":2}strata event range-time 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_by_time(0)]
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| direction | EventRangeDirection | yes | Result ordering.one of: forward, reverse |
| start_ts | integer | yes | Inclusive start timestamp in microseconds. |
| branch | string or null | no | Target branch. Defaults to the executor handle branch. |
| end_ts | integer or null | no | Optional exclusive end timestamp in microseconds (half-open window, matching the sequence-addressed range's exclusive end). |
| 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 |