Skip to content

Commit

Permalink
Merge pull request #35 from JacobSMoller/master
Browse files Browse the repository at this point in the history
Expose conversion code as package
  • Loading branch information
mescanne committed Jun 24, 2022
2 parents f55a7d2 + 144a04e commit 34288dc
Show file tree
Hide file tree
Showing 11 changed files with 559 additions and 539 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: '^1.15'
- name: Checkout code
uses: actions/checkout@v2
- name: Install protoc
uses: arduino/setup-protoc@v1
- name: Install protoc-gen-go
run: go get -u github.com/golang/protobuf/protoc-gen-go
- name: Checkout code
uses: actions/checkout@v2

# Formatting, go mod tidy, and re-generate proto extension code
- name: Run go fmt on all modules
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ So you can reuse existing data definitions in .proto for BigQuery with this plug
## Installation

```sh
go get github.com/GoogleCloudPlatform/protoc-gen-bq-schema
go install github.com/GoogleCloudPlatform/protoc-gen-bq-schema@latest
```

## Usage
Expand Down Expand Up @@ -74,8 +74,8 @@ The message `foo.Baz` is also ignored because it is not the first message in the


### Support for PolicyTags
`protoc-gen-bq-schema` now supports [policyTags](https://cloud.google.com/bigquery/docs/column-level-security-intro).
You can define a `Policy Tag` for a field in `.proto` file.
`protoc-gen-bq-schema` now supports [policyTags](https://cloud.google.com/bigquery/docs/column-level-security-intro).
You can define a `Policy Tag` for a field in `.proto` file.

### Example with Policy Tags
Suppose that you have the following `test_table.proto`
Expand All @@ -94,7 +94,7 @@ message TestTable{
policy_tags : "private"
}
];
string b = 2 [(gen_bq_schema.bigquery).policy_tags="public"];
message Nested {
Expand Down Expand Up @@ -165,7 +165,7 @@ It will generate the following `JSON` schema
]
```

The policy tag name provided in `test_table.proto` file is taken as it is. According to [Google Docs](https://cloud.google.com/bigquery/docs/column-level-security-intro),
The policy tag name provided in `test_table.proto` file is taken as it is. According to [Google Docs](https://cloud.google.com/bigquery/docs/column-level-security-intro),
the policy tag string should be of the following format

`projects/project-id/locations/location/taxonomies/taxonomy-id/policyTags/policytag-id`
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ go 1.15
require (
github.com/golang/glog v1.0.0
github.com/golang/protobuf v1.5.2
google.golang.org/protobuf v1.26.0
google.golang.org/protobuf v1.28.0
)
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
Loading

0 comments on commit 34288dc

Please sign in to comment.