bqexport is a
go:generate utility to generate Go structs based on BigQuery
schema protobufs compatible with bqschemaupdater.
These structs can then be used in combination with
eventupload to send events to BigQuery.
- Create a TableDef protobuf.
- Once your protobuf has been reviewed and committed, run the bqexport command:
bqexport --help. Don't have bqexport in your path? Try this inside the infra Go env.
- Add a
generate.goin your Go package alongside your generated file:
//go:generate go install infra/cmd/bqexport //go:generate bqexport -name MyStruct -path /path/to/tabledef.pb.txt
bqexport loads a BigQuery struct definition from Go source and exports a table definition protobuf suitable for "bqschemaupdater" to instantiate and process.
The "d=" tag instructs "bqexport" to read the remainder of the tag as a field description.