Skip to content

Commit

Permalink
chore: Generate marshal/unmarshal with vtprotobuf (#1467)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleconroy committed Mar 2, 2022
1 parent 3415bdd commit ccf980b
Show file tree
Hide file tree
Showing 4 changed files with 6,222 additions and 8 deletions.
22 changes: 18 additions & 4 deletions Makefile
Expand Up @@ -39,7 +39,21 @@ mysqlsh:
mysqlsh --sql --user root --password mysecretpassword --database dinotest 127.0.0.1:3306

# $ protoc --version
# libprotoc 3.17.3
# go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
proto:
protoc -I ./protos --go_out=. --go_opt=module=github.com/kyleconroy/sqlc ./protos/**/*.proto
# libprotoc 3.19.1
# $ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
# $ go install github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto
proto: internal/plugin/codegen.pb.go internal/python/ast/ast.pb.go

internal/plugin/codegen.pb.go: protos/plugin/codegen.proto
protoc -I ./protos \
--go_out=. \
--go_opt=module=github.com/kyleconroy/sqlc \
--go-vtproto_out=. \
--go-vtproto_opt=module=github.com/kyleconroy/sqlc,features=marshal+unmarshal+size \
./protos/plugin/codegen.proto

internal/python/ast/ast.pb.go: protos/python/ast.proto
protoc -I ./protos \
--go_out=. \
--go_opt=module=github.com/kyleconroy/sqlc \
./protos/python/ast.proto
4 changes: 2 additions & 2 deletions internal/plugin/codegen.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ccf980b

Please sign in to comment.