kv

put

Store or replace a KV value by key.

strata kv put

wire kv_put

Writes a binary value to the selected KV space. If the key already exists, Strata replaces the visible value and records a new version.

Successful mutations return an acknowledgement of the outcome: for a state-changing write, the affected target with the mutation effect and commit facts; for mutations that produce a domain result (such as a branch or a promotion outcome), that result object.

To see the complete help for this command, run:

strata kv put --help

Example

Store a value, then replace it.

strata kv put setting v1created settingstrata kv put setting v2  # replaces the visible valueupdated settingstrata kv get settingv2

Parameters

NameTypeRequiredDescription
keyBytesyesKey bytes.
valueBytesyesValue bytes.
branchstring or nullnoTarget branch. Defaults to the executor handle branch.
spacestring or nullnoTarget product space. Defaults to `"default"`.

Returns

MutationAck

  • dataobject
  • typestring

Errors

Recover by code. Retry policy and commit outcome come from the shipped error registry.

CodeRetryCommit outcome
failed_precondition.engine.runtime_closednevernot_started
not_found.engine.branchnevernot_applicable
invalid_argument.engine.product_spacenevernot_started
invalid_argument.engine.kv_keynevernot_started
← All 13 Key-value commands

agents: this page as markdown → /docs/reference/kv/put.md