protoc-gen-bq-schema/examples/foo.proto

42 строки
854 B
Protocol Buffer

syntax = "proto2";
package foo;
import "bq_table.proto";
import "bq_field.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/timestamp.proto";
message Bar {
option (gen_bq_schema.bigquery_opts).table_name = "bar_table";
message Nested {
repeated int32 a = 1;
}
// Description of field a -- this is an int32
required int32 a = 1;
// Nested b structure
optional Nested b = 2;
// Repeated c string
repeated string c = 3;
optional bool d = 4 [(gen_bq_schema.bigquery).ignore = true];
// TIMESTAMP (uint64 in proto) - required in BigQuery
optional uint64 e = 5 [
(gen_bq_schema.bigquery) = {
require: true
type_override: 'TIMESTAMP'
}
];
optional google.protobuf.Int32Value wkt1 = 11;
optional google.protobuf.Timestamp wkt2 = 12;
}
message Baz {
required int32 a = 1;
}