Skip to content
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

feat: add support for clickhouse as the engine #255

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ example/user/*.pb.go: example/user/*.proto
example/postgres_arrays/*.pb.go: example/postgres_arrays/*.proto
buf generate --template example/postgres_arrays/buf.gen.yaml --path example/postgres_arrays

example/clickhouse_arrays/*.pb.go: example/clickhouse_arrays/*.proto
buf generate --template example/clickhouse_arrays/buf.gen.yaml --path example/clickhouse_arrays

install:
go install -v .

Expand Down
19 changes: 19 additions & 0 deletions example/clickhouse_arrays/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
all: protos

protos:
@protoc \
-I /usr/local/include \
-I ${GOPATH}/src \
--go_out=${GOPATH}/src \
--gorm_out=engine=clickhouse:${GOPATH}/src \
--proto_path=. \
clickhouse_arrays.proto

protos_without_clickhouse:
@protoc \
-I /usr/local/include \
-I ${GOPATH}/src \
--go_out=${GOPATH}/src \
--gorm_out=${GOPATH}/src \
--proto_path=. \
clickhouse_arrays.proto
8 changes: 8 additions & 0 deletions example/clickhouse_arrays/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: v1
plugins:
- plugin: buf.build/protocolbuffers/go:v1.30.0
out: example
opt: paths=source_relative
- plugin: gorm
out: example
opt: engine=clickhouse,paths=source_relative,enums=string,gateway=true:./example/clickhouse_arrays
205 changes: 205 additions & 0 deletions example/clickhouse_arrays/clickhouse_arrays.pb.go

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

Loading
Loading