Open andrewmbenton opened 11 months ago
Hi @andrewmbenton!
Since this project was created before the possibility of writing plugins, the architecture is quite different. In my opinion, the best approach would be to fork the sqlc-gen-go repository and implement gRPC support. What do you think?
sqlc WASM plugin: https://github.com/walterwanderley/sqlc-gen-go-server
A suggestion from this Twitter thread is to implement the project as a sqlc WASM plugin. This would allow users to get the grpc codegen output from this project directly from
sqlc generate
. An example sqlc.yaml config might look like:Running
sqlc generate
with this config would put both the typical sqlc Go codegen output and the grpc output from this project in thesqlc
directory.There's a sqlc plugin sdk for Go which should make the implementation a little more straightforward.
The only hiccup I can think of would be that sqlc's
GenerateRequest
proto message that sqlc hands to a plugin may not have enough information to support the grpc codegen work as you've currently implemented it.