Protocol Buffers plugin to generate SQL schema and queries with sqlc annotations.
You can download and compile the latest version from source using Go directly:
go install github.com/pablojimpas/protoc-gen-sqlc/cmd/protoc-gen-sqlc@latest
or you can download pre-built binaries from the Github releases page.
To use buf
you have to make a config file called buf.gen.yaml
with your
options, like this:
version: v2
plugins:
- local: protoc-gen-sqlc
out: out
And then run buf generate
. See the documentation on buf
generate for more
help.
This plugin works with protoc
as well. Here's a basic usage example:
protoc example.proto --sqlc_out=gen