Skip to content

feat(plugin): Use gRPC interface for codegen plugin communication #2930

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

Merged
merged 4 commits into from
Nov 1, 2023

Conversation

andrewmbenton
Copy link
Collaborator

I propose to introduce a service block at the top of codegen.proto which currently defines a single rpc named Generate which takes and returns the existing codegen proto messages. Establishing a way for codegen plugins to interact with sqlc in an extensible way is the goal.

I use the generated grpc client stub as a proof-of-concept, implementing a basic client conn interface for each of our three plugin types (built-in, process and wasm). The implementation doesn't yet expect a plugin to handle anything other than the existing codegen call, though I do pass the method parameter as an argument to process and wasm plugins with the expectation that we will update our plugin-building sdk to use generated server stubs and implement a handler "router" of some kind.

@andrewmbenton andrewmbenton force-pushed the andrew/codegen-plugin-grpc branch from 021b6aa to afe114f Compare November 1, 2023 21:40
@andrewmbenton andrewmbenton marked this pull request as ready for review November 1, 2023 22:17
Copy link
Collaborator

@kyleconroy kyleconroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the vtproto code

@andrewmbenton andrewmbenton merged commit 4507ede into main Nov 1, 2023
@andrewmbenton andrewmbenton deleted the andrew/codegen-plugin-grpc branch November 1, 2023 23:01
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.

2 participants