event
batch_append
Append multiple events in one commit.
db.events.append_many(entries: 'Any') -> 'BatchResult'wire event_batch_append
Appends multiple events to the selected branch and space in one engine commit. Sequences are assigned in entry order. Entries that fail validation report a positional item error while valid entries still append.
Itemwise batches return one positional item result per input item. The outer batch status summarizes whether all, some, or none of the items succeeded.
To see the complete help for this command, run:
help(db.events.append_many)
Example
Append many events in one commit.
_ = db.events.append_many([{"event_type": "user.created", "payload": {"id": 1}}, {"event_type": "user.updated", "payload": {"id": 2}}])db.events.len()
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| entries | array | yes | Events to append. |
| branch | string or null | no | Target branch. Defaults to the executor handle branch. |
| space | string or null | no | Target product space. Defaults to `"default"`. |
Returns
BatchResult<EventBatchAppendItem>
- dataBatchResult9
- 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_batch | never | not_started |
| invalid_argument.engine.event_type | never | not_started |
| invalid_argument.engine.event_payload | never | not_started |
| invalid_argument.engine.event_payload_too_large | never | not_started |