-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bindings for pg_query_deparse_protobuf #32
Conversation
This is awesome, thanks for your contribution! 🥳 |
@tomquist would https://github.com/protocolbuffers/protobuf-javascript work instead? |
oops, I deleted |
Would love to breathe life back into this! I've actually written protobuf parsers from scratch (see https://github.com/cosmology-tech/telescope) @tomquist was this PR working for you? If so, I can look into the details of the option I could also make a nice pipeline for updating the proto.js that gets generated. I'll take a deeper look :) |
NOTE: I think this is a great start, I can work with this! |
I'm gonna merge this PR into a dev branch, and work on this! |
new PR #63 |
This exposes deparse functionality to node.js. As of this issue the recommended approach is to generate a protobuf message from the JSON parse tree. One blocking issue is that
protobufjs
doesn't honor thejson_name
attribute so it isn't able to parse the existing structure into a protobuf message. There's a PR to add this, however, this seems to be stale atm. In this PR I worked around this by directly pointing to the fork and generating a static JS model from it that I checked in. By checking in the model we could also point back to the original library, however, this makes updating the static model more cumbersome.This pull request adds bindings for pg_query_deparse_protobuf to expose deparse functionality for Node.js. Currently, the recommended approach is to generate a protobuf message from the JSON parse tree, but the protobufjs library doesn't honor the
json_name
attribute, which blocks parsing of the existing structure into a protobuf message. Although a PR to address this issue is available here, it seems stale at the moment.In this PR, a workaround has been implemented by directly pointing to the fork and generating a static JS model from it that is checked in. While checking in the model allows for pointing back to the original library, it also makes updating the static model more cumbersome.