Skip to content

Commit

Permalink
add external sql option and skip schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris committed Feb 2, 2023
1 parent dbf9a41 commit e2c0cf5
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 13 deletions.
6 changes: 6 additions & 0 deletions bq_table.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,10 @@ message BigQueryMessageOptions {
// or "<field name>:RECORD:<protobuf type>" for message types.
// "NULLABLE" by default, different mode may be set via optional suffix ":<mode>"
repeated string extra_fields = 3;

// If set, execute specified sql file to create schema, use for extra views or materialized tables
repeated string sql = 10;

// If set, skip using the schema to create this table (use with sql option)
bool skip_schema = 11;
}
1 change: 0 additions & 1 deletion pkg/converter/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ var (
".google.protobuf.BytesValue": "BYTES",
".google.protobuf.Duration": "STRING",
".google.protobuf.Timestamp": "TIMESTAMP",
".google.type.Date": "DATE",
}
typeFromFieldType = map[descriptor.FieldDescriptorProto_Type]string{
descriptor.FieldDescriptorProto_TYPE_DOUBLE: "FLOAT",
Expand Down
45 changes: 33 additions & 12 deletions protos/bq_table.pb.go

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

0 comments on commit e2c0cf5

Please sign in to comment.