Add comprehensive protobuf support for reading & comparing protobuf data #4
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.
This PR adds full support for reading and comparing Protocol Buffer (protobuf) data to the stream-diff tool, addressing the feature request to support protobuf data sources alongside the existing CSV and JSON support.
What's Added
New Protobuf Data Reader
.jsonpbfiles)protobufandprotoas valid source types for convenienceprofile.preferences.theme)Example Usage
Schema Generation Integration
The protobuf reader seamlessly integrates with the existing schema generation system:
numeric,string,datetime,object, andarraytypes from protobuf dataTest Coverage
Technical Implementation
The implementation follows the existing patterns established by the CSV and JSON readers:
DataReaderinterface for consistent behaviordatareader.New()to support protobuf typesThis change enables users to compare protobuf data streams using the same powerful schema detection, field analysis, and reporting capabilities that were previously available only for CSV and JSON data sources.
Dependencies
Added
google.golang.org/protobuf v1.36.9for future binary protobuf support (currently used minimally for JSON format handling).💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.