feat: PROTO.SETFIELD and PROTO.DELFIELD for field-level mutations - #88
Merged
Conversation
adds server-side field mutation for stored protobuf values: - PROTO.SETFIELD key field_path value — updates a single scalar field, parsing the raw string value based on the field's type descriptor. supports string, int32/64, uint32/64, float, double, bool, bytes, and enum fields. returns OK on success, Null for missing key. - PROTO.DELFIELD key field_path — clears a field to its proto default. returns Integer(1) on success, Null for missing key. both commands use a GET-decode-mutate-encode-SET pattern, routing through existing ProtoGet/ProtoSet shard requests. no changes to shard, keyspace, or persistence layers. known limitations: - TTL is not preserved (SETFIELD/DELFIELD reset it via ProtoSet) - non-atomic: concurrent field mutations may cause lost updates - scalars only: repeated, map, and message fields return errors schema registry additions: - set_field(), clear_field() public methods - parse_field_value() for type-aware string parsing - resolve_field_path_mut() for mutable nested path traversal includes unit tests for all mutation paths and 12 new integration tests across sharded and concurrent modes.
- replace unreachable!() with proper error returns in resolve_field_path and resolve_field_path_mut to eliminate potential panics - replace .expect() with .ok_or_else() in resolve_field_path_mut - handle u64 > i64::MAX in value_to_frame by falling back to bulk string instead of silently wrapping to negative via `as i64` - add protobuf storage section to README with all 9 PROTO commands - update command count from 85 to 94 and test count to 967
kacy
force-pushed
the
feat/proto-setfield-delfield
branch
from
February 11, 2026 01:30
ab1219f to
5c7c860
Compare
kacy
added a commit
that referenced
this pull request
Feb 11, 2026
* feat: PROTO.SETFIELD and PROTO.DELFIELD for field-level mutations adds server-side field mutation for stored protobuf values: - PROTO.SETFIELD key field_path value — updates a single scalar field, parsing the raw string value based on the field's type descriptor. supports string, int32/64, uint32/64, float, double, bool, bytes, and enum fields. returns OK on success, Null for missing key. - PROTO.DELFIELD key field_path — clears a field to its proto default. returns Integer(1) on success, Null for missing key. both commands use a GET-decode-mutate-encode-SET pattern, routing through existing ProtoGet/ProtoSet shard requests. no changes to shard, keyspace, or persistence layers. known limitations: - TTL is not preserved (SETFIELD/DELFIELD reset it via ProtoSet) - non-atomic: concurrent field mutations may cause lost updates - scalars only: repeated, map, and message fields return errors schema registry additions: - set_field(), clear_field() public methods - parse_field_value() for type-aware string parsing - resolve_field_path_mut() for mutable nested path traversal includes unit tests for all mutation paths and 12 new integration tests across sharded and concurrent modes. * fix: harden proto field ops and document protobuf commands - replace unreachable!() with proper error returns in resolve_field_path and resolve_field_path_mut to eliminate potential panics - replace .expect() with .ok_or_else() in resolve_field_path_mut - handle u64 > i64::MAX in value_to_frame by falling back to bulk string instead of silently wrapping to negative via `as i64` - add protobuf storage section to README with all 9 PROTO commands - update command count from 85 to 94 and test count to 967
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
summary
adds two new commands for server-side field mutation of stored protobuf values:
PROTO.SETFIELD key field_path value— updates a single scalar field by parsing the raw string value based on the field's type descriptor (string, int32/64, uint32/64, float, double, bool, bytes, enum)PROTO.DELFIELD key field_path— clears a field to its protobuf default valueboth commands use a GET→decode→mutate→encode→SET pattern, reusing existing
ProtoGet/ProtoSetshard requests. no changes to shard, keyspace, or persistence layers.depends on #87 (PROTO.GETFIELD).
what was tested
cargo clippy --workspace --features protobuf -- -D warningscleancargo checkwithout protobuf feature (no regressions)cargo fmt --checkcleandesign considerations
XXflag (only if key still exists). this avoids adding new shard request types but means TTL is not preserved and concurrent mutations are non-atomic.PROTO.SETfor full replacement. this keeps the API surface clean and avoids ambiguous partial update semantics.parse_field_valueconverts raw strings to typed protobuf values based on the field descriptor'sKind. bool accepts "true"/"false"/"1"/"0", enums accept names or numeric values.