Skip to content

feat: PROTO.SCAN and PROTO.FIND#342

Merged
kacy merged 1 commit intomainfrom
worktree-linear-scribbling-lark
Feb 28, 2026
Merged

feat: PROTO.SCAN and PROTO.FIND#342
kacy merged 1 commit intomainfrom
worktree-linear-scribbling-lark

Conversation

@kacy
Copy link
Owner

@kacy kacy commented Feb 28, 2026

summary

adds two cursor-based scan commands for protobuf key discovery:

PROTO.SCAN cursor [MATCH pattern] [COUNT count] [TYPE typename]
scans all proto keys with optional message-type and glob-pattern filters — same cursor contract as SCAN.

PROTO.FIND cursor field-path value [MATCH pattern] [TYPE typename] [COUNT count]
walks proto keys returning those where a scalar field equals the given value. dot-separated paths supported via the existing field resolver in schema.rs. non-scalar fields (message, repeated, map) are silently skipped.

what was tested

  • 9 new integration tests: proto_scan_all_keys, proto_scan_type_filter, proto_scan_match_pattern, proto_scan_cursor_consistency, proto_find_scalar_match, proto_find_nested_path, proto_find_type_filter, proto_find_no_match, proto_find_count_pagination
  • all 53 proto integration tests pass
  • cargo clippy and cargo fmt clean

design considerations

cursor encoding reuses the existing (shard_id << 48) | position scheme from SCAN, so no new cursor infrastructure is needed. field value comparison is string-based after get_field_str() stringifies the decoded proto value — booleans become "true"/"false", numbers their decimal representation, strings verbatim. this avoids leaking frame semantics into the schema layer and naturally handles the types users are most likely to filter on.

introduce ProtoFindOpts struct to stay within the 7-argument clippy
limit, re-export it from keyspace/mod.rs, fix visibility (pub not
pub(crate)), and apply cargo fmt.
@kacy kacy force-pushed the worktree-linear-scribbling-lark branch from 1fcfbf1 to 02c1889 Compare February 28, 2026 14:51
@kacy kacy merged commit c0f23c0 into main Feb 28, 2026
@kacy kacy deleted the worktree-linear-scribbling-lark branch February 28, 2026 14: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