sqlite_protobuf icon indicating copy to clipboard operation
sqlite_protobuf copied to clipboard

Refactor protobuf_extract()

Open rgov opened this issue 6 years ago • 0 comments

  • There are two switch statements that cover all different field types, one for returning a default value of an optional field that is not present, and one for returning the value of a field that is present. The latter is additionally verbose because it has to handle repeated vs non-repeated fields in each case.

  • The path traversal code will be useful for other functions like protobuf_each and so it should be re-usable. There could be a traversal function that accepts a serialized message and a path, and returns the sub-message and field descriptor and any error condition (e.g., index of bounds, intermediate path component does not exist, etc.).

rgov avatar Jan 02 '19 06:01 rgov