Skip to content

feat: PROTO.GETFIELD for field-level protobuf reads - #87

Merged
kacy merged 1 commit into
mainfrom
feat/proto-getfield
Feb 10, 2026
Merged

feat: PROTO.GETFIELD for field-level protobuf reads#87
kacy merged 1 commit into
mainfrom
feat/proto-getfield

Conversation

@kacy

@kacy kacy commented Feb 10, 2026

Copy link
Copy Markdown
Owner

summary

adds PROTO.GETFIELD key field_path — reads a single field from a stored protobuf value and returns it as a native RESP3 type. supports dot-separated nested paths (e.g., address.city).

return type mapping:

  • string → Bulk
  • int32/int64/uint32/uint64 → Integer
  • bool → Integer (1/0)
  • float/double → Bulk (formatted string)
  • bytes → Bulk
  • enum → Bulk (value name)
  • message/list/map → Error (use PROTO.GET)

this is phase 2, PR 1 of the protobuf field-level access feature. field mutations (PROTO.SETFIELD, PROTO.DELFIELD) follow in the next PR.

what was tested

  • unit tests for all scalar field types, default values, nested path traversal, nonexistent field errors, and empty path errors (7 new tests in schema.rs)
  • command parse tests for valid commands, nested paths, and wrong arity (3 new tests in command.rs)
  • integration tests covering sharded + concurrent modes: getfield_string, getfield_missing_key, getfield_wrong_type, getfield_nonexistent_field, getfield_default_value, concurrent_getfield_string (6 new integration tests)
  • cargo clippy --workspace --features protobuf -- -D warnings clean
  • cargo check without protobuf feature (no regressions)

design considerations

  • field operations are server-side: the server decodes the stored blob using the schema registry, extracts the field, and converts to RESP3. no changes to shard or keyspace layers.
  • resolve_field_path clones the DynamicMessage to avoid lifetime issues with nested traversal. acceptable overhead since this is a read-only decode operation.
  • complex types (nested messages, repeated fields, maps) return errors directing clients to PROTO.GET for full deserialization — keeps the API surface clean and avoids ambiguous serialization choices.

adds server-side field extraction from stored protobuf values,
returning native RESP3 types. supports dot-separated nested
paths (e.g., `address.city`). scalars map to native frames;
complex types (message/list/map) return an error directing
clients to use PROTO.GET.

- FieldNotFound error variant in SchemaError
- get_field(), resolve_field_path(), value_to_frame() in schema registry
- ProtoGetField command variant + parser
- handlers in both sharded and concurrent modes
- unit tests for all field types and edge cases
- integration tests for sharded + concurrent modes
@kacy
kacy merged commit 34e61d7 into main Feb 10, 2026
5 of 7 checks passed
@kacy
kacy deleted the feat/proto-getfield branch February 10, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant