Skip to content

Commit 6eb27c0

Browse files
authoredDec 2, 2022
setup bufbuild to generate proto (#1974)
1 parent 9e13aa7 commit 6eb27c0

File tree

6 files changed

+577
-21
lines changed

6 files changed

+577
-21
lines changed
 

‎Makefile

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: build build-endtoend test test-ci test-examples test-endtoend regen start psql mysqlsh
1+
.PHONY: build build-endtoend test test-ci test-examples test-endtoend regen start psql mysqlsh proto
22

33
build:
44
go build ./...
@@ -44,16 +44,5 @@ psql:
4444
mysqlsh:
4545
mysqlsh --sql --user root --password mysecretpassword --database dinotest 127.0.0.1:3306
4646

47-
# $ protoc --version
48-
# libprotoc 3.19.1
49-
# $ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
50-
# $ go install github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto
51-
proto: internal/plugin/codegen.pb.go
52-
53-
internal/plugin/codegen.pb.go: protos/plugin/codegen.proto
54-
protoc -I ./protos \
55-
--go_out=. \
56-
--go_opt=module=github.com/kyleconroy/sqlc \
57-
--go-vtproto_out=. \
58-
--go-vtproto_opt=module=github.com/kyleconroy/sqlc,features=marshal+unmarshal+size \
59-
./protos/plugin/codegen.proto
47+
proto:
48+
buf generate

‎buf.gen.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: v1
2+
managed:
3+
enabled: true
4+
plugins:
5+
- remote: buf.build/protocolbuffers/plugins/go:v1.28.1-1
6+
out: internal
7+
opt: paths=source_relative
8+
- remote: buf.build/planetscale/plugins/vtproto:v0.3.0
9+
out: internal
10+
opt: paths=source_relative

‎buf.work.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version: v1
2+
directories:
3+
- protos

‎internal/plugin/codegen.pb.go

Lines changed: 11 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎internal/plugin/codegen_vtproto.pb.go

Lines changed: 542 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎protos/buf.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: v1
2+
name: github.com/kyleconroy/sqlc
3+
breaking:
4+
lint:
5+
use:
6+
- DEFAULT
7+
except:
8+
- PACKAGE_VERSION_SUFFIX

0 commit comments

Comments
 (0)
Please sign in to comment.