From e3678bb5c4432021409e253b29fc9dfc14da1296 Mon Sep 17 00:00:00 2001 From: kaidaguerre Date: Tue, 28 Nov 2023 07:32:26 -0600 Subject: [PATCH] Update proto.ColumnDefinition (part of GetSchemaResponse) to include column default and hydrate func. Closes #711 --- grpc/proto/column.go | 33 +++ grpc/proto/plugin.pb.go | 405 +++++++++++++++++++------------------ grpc/proto/plugin.proto | 2 + grpc/proto/table_schema.go | 16 ++ plugin/column.go | 132 ++++++++++++ plugin/table_column.go | 135 +------------ plugin/table_schema.go | 15 ++ 7 files changed, 414 insertions(+), 324 deletions(-) create mode 100644 grpc/proto/column.go diff --git a/grpc/proto/column.go b/grpc/proto/column.go new file mode 100644 index 00000000..c942690b --- /dev/null +++ b/grpc/proto/column.go @@ -0,0 +1,33 @@ +package proto + +import ( + "encoding/json" + "github.com/golang/protobuf/ptypes" + "google.golang.org/protobuf/reflect/protoreflect" +) + +func (x *Column) ValueToInterface() (any, error) { + // extract x value as interface from protobuf message + var val any + if bytes := x.GetJsonValue(); bytes != nil { + if err := json.Unmarshal(bytes, &val); err != nil { + return nil, err + } + } else if timestamp := x.GetTimestampValue(); timestamp != nil { + // convert from protobuf timestamp to a RFC 3339 time string + val = ptypes.TimestampString(timestamp) + } else { + // get the first field descriptor and value (we only expect x message to contain a single field + x.ProtoReflect().Range(func(descriptor protoreflect.FieldDescriptor, v protoreflect.Value) bool { + // is this value null? + if descriptor.JSONName() == "nullValue" { + val = nil + } else { + val = v.Interface() + } + return false + }) + } + + return val, nil +} diff --git a/grpc/proto/plugin.pb.go b/grpc/proto/plugin.pb.go index 4a2ca7c9..485a0a34 100644 --- a/grpc/proto/plugin.pb.go +++ b/grpc/proto/plugin.pb.go @@ -2329,9 +2329,9 @@ func (*Column) Descriptor() ([]byte, []int) { return file_plugin_proto_rawDescGZIP(), []int{31} } -func (m *Column) GetValue() isColumn_Value { - if m != nil { - return m.Value +func (x *Column) GetValue() isColumn_Value { + if x != nil { + return x.Value } return nil } @@ -2488,6 +2488,8 @@ type ColumnDefinition struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Type ColumnType `protobuf:"varint,2,opt,name=type,proto3,enum=proto.ColumnType" json:"type,omitempty"` Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Hydrate string `protobuf:"bytes,4,opt,name=hydrate,proto3" json:"hydrate,omitempty"` + Default *Column `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"` } func (x *ColumnDefinition) Reset() { @@ -2543,6 +2545,20 @@ func (x *ColumnDefinition) GetDescription() string { return "" } +func (x *ColumnDefinition) GetHydrate() string { + if x != nil { + return x.Hydrate + } + return "" +} + +func (x *ColumnDefinition) GetDefault() *Column { + if x != nil { + return x.Default + } + return nil +} + type QueryResult struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3510,160 +3526,164 @@ var file_plugin_proto_rawDesc = []byte{ 0x69, 0x64, 0x72, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x6c, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0a, 0x6c, 0x74, 0x72, 0x65, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x6f, 0x0a, 0x10, 0x43, 0x6f, 0x6c, - 0x75, 0x6d, 0x6e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x25, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2d, 0x0a, 0x0b, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1e, 0x0a, 0x04, 0x72, 0x6f, 0x77, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x52, 0x6f, 0x77, 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x22, 0x35, 0x0a, 0x0b, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x26, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, - 0x22, 0xaa, 0x02, 0x0a, 0x09, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x10, - 0x0a, 0x03, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4b, 0x65, 0x79, - 0x12, 0x31, 0x0a, 0x05, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x49, 0x74, 0x65, - 0x6d, 0x2e, 0x51, 0x75, 0x61, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, - 0x61, 0x6c, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x14, 0x0a, - 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x0e, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0d, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, - 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0x46, 0x0a, 0x0a, 0x51, 0x75, 0x61, 0x6c, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x22, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x51, 0x75, 0x61, - 0x6c, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x64, 0x0a, - 0x16, 0x53, 0x65, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, - 0x74, 0x74, 0x6c, 0x12, 0x1e, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, - 0x6d, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x53, 0x69, 0x7a, - 0x65, 0x4d, 0x62, 0x22, 0x19, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5f, - 0x0a, 0x20, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, - 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x1a, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, 0x63, 0x61, 0x63, 0x68, - 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x43, 0x61, 0x63, - 0x68, 0x65, 0x46, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0x23, 0x0a, 0x21, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x15, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, - 0x69, 0x74, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, + 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xb2, 0x01, 0x0a, 0x10, 0x43, 0x6f, + 0x6c, 0x75, 0x6d, 0x6e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x6c, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x6c, 0x52, 0x61, 0x74, 0x65, 0x12, - 0x1f, 0x0a, 0x0b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, - 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x63, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x43, 0x6f, - 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, - 0x70, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x77, 0x68, 0x65, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x77, 0x68, 0x65, 0x72, 0x65, 0x22, 0x58, 0x0a, 0x16, 0x53, 0x65, 0x74, 0x52, 0x61, 0x74, 0x65, - 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x3e, 0x0a, 0x0b, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x61, 0x74, - 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, - 0x19, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x0a, 0x16, 0x47, 0x65, - 0x74, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x22, 0x59, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x52, 0x61, 0x74, 0x65, 0x4c, - 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x3e, 0x0a, 0x0b, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x61, 0x74, + 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x68, + 0x79, 0x64, 0x72, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x68, 0x79, + 0x64, 0x72, 0x61, 0x74, 0x65, 0x12, 0x27, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, + 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x2d, + 0x0a, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1e, 0x0a, + 0x04, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x6f, 0x77, 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x22, 0x35, 0x0a, + 0x0b, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x26, 0x0a, 0x05, + 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x22, 0xaa, 0x02, 0x0a, 0x09, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x49, 0x74, + 0x65, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x4b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x49, 0x74, 0x65, 0x6d, 0x2e, 0x51, 0x75, 0x61, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x05, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, + 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x61, 0x67, + 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x0e, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0d, 0x69, 0x6e, 0x73, 0x65, + 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0x46, 0x0a, 0x0a, 0x51, 0x75, 0x61, + 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x22, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x51, 0x75, 0x61, 0x6c, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0x64, 0x0a, 0x16, 0x53, 0x65, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x6c, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x03, 0x74, 0x74, 0x6c, 0x12, 0x1e, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x73, + 0x69, 0x7a, 0x65, 0x5f, 0x6d, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, + 0x78, 0x53, 0x69, 0x7a, 0x65, 0x4d, 0x62, 0x22, 0x19, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x43, 0x61, + 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x5f, 0x0a, 0x20, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x1a, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x5f, + 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x63, 0x6c, 0x65, 0x61, + 0x72, 0x43, 0x61, 0x63, 0x68, 0x65, 0x46, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0x23, 0x0a, 0x21, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x15, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2a, - 0x27, 0x0a, 0x11, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x43, 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x55, - 0x50, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, 0x00, 0x2a, 0x1b, 0x0a, 0x09, 0x4e, 0x75, 0x6c, 0x6c, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x55, 0x4c, 0x4c, 0x5f, 0x56, 0x41, - 0x4c, 0x55, 0x45, 0x10, 0x00, 0x2a, 0x9f, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x4f, 0x4f, 0x4c, 0x10, 0x00, 0x12, 0x07, - 0x0a, 0x03, 0x49, 0x4e, 0x54, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x4f, 0x55, 0x42, 0x4c, - 0x45, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, - 0x08, 0x0a, 0x04, 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x41, 0x54, - 0x45, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x49, 0x50, 0x41, 0x44, 0x44, - 0x52, 0x10, 0x06, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x49, 0x44, 0x52, 0x10, 0x07, 0x12, 0x0d, 0x0a, - 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10, 0x08, 0x12, 0x08, 0x0a, 0x04, - 0x49, 0x4e, 0x45, 0x54, 0x10, 0x09, 0x12, 0x09, 0x0a, 0x05, 0x4c, 0x54, 0x52, 0x45, 0x45, 0x10, - 0x0a, 0x12, 0x14, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x32, 0xde, 0x07, 0x0a, 0x0d, 0x57, 0x72, 0x61, 0x70, - 0x70, 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x56, 0x0a, 0x16, 0x45, 0x73, 0x74, - 0x61, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x73, 0x74, 0x61, - 0x62, 0x6c, 0x69, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x30, - 0x01, 0x12, 0x3e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x17, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x12, 0x15, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x5c, 0x0a, - 0x13, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x74, - 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x64, 0x0a, 0x17, 0x53, - 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, - 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x68, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, 0x25, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x16, 0x47, - 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, - 0x74, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, - 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, - 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x74, - 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x52, 0x61, 0x74, 0x65, 0x4c, - 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x53, 0x65, 0x74, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, - 0x65, 0x74, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x52, 0x61, 0x74, - 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, + 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x6c, 0x5f, 0x72, + 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x6c, 0x52, + 0x61, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x73, 0x69, + 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x53, 0x69, 0x7a, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6f, 0x6e, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x6d, + 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, + 0x6f, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x68, 0x65, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x77, 0x68, 0x65, 0x72, 0x65, 0x22, 0x58, 0x0a, 0x16, 0x53, 0x65, 0x74, + 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x0b, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, + 0x0a, 0x16, 0x47, 0x65, 0x74, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x59, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x52, + 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2a, 0x27, 0x0a, 0x11, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x43, 0x48, 0x45, + 0x4d, 0x41, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, 0x00, 0x2a, 0x1b, 0x0a, 0x09, + 0x4e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x55, 0x4c, + 0x4c, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x10, 0x00, 0x2a, 0x9f, 0x01, 0x0a, 0x0a, 0x43, 0x6f, + 0x6c, 0x75, 0x6d, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x4f, 0x4f, 0x4c, + 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x49, 0x4e, 0x54, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x44, + 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, + 0x47, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x04, 0x12, 0x0c, 0x0a, + 0x08, 0x44, 0x41, 0x54, 0x45, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x49, + 0x50, 0x41, 0x44, 0x44, 0x52, 0x10, 0x06, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x49, 0x44, 0x52, 0x10, + 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10, 0x08, + 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x45, 0x54, 0x10, 0x09, 0x12, 0x09, 0x0a, 0x05, 0x4c, 0x54, + 0x52, 0x45, 0x45, 0x10, 0x0a, 0x12, 0x14, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, + 0x10, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x32, 0xde, 0x07, 0x0a, 0x0d, + 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x56, 0x0a, + 0x16, 0x45, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x45, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x30, 0x01, 0x12, 0x3e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x12, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, + 0x12, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, + 0x01, 0x12, 0x5c, 0x0a, 0x13, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x64, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, + 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, + 0x12, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x65, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6f, + 0x72, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x43, 0x61, 0x63, + 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a, 0x19, 0x53, 0x65, 0x74, 0x43, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, - 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x63, 0x68, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x53, 0x65, 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x52, + 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, + 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0f, 0x47, 0x65, + 0x74, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x73, 0x12, 0x1d, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a, 0x19, + 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x63, + 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, + 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09, 0x5a, 0x07, + 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3776,44 +3796,45 @@ var file_plugin_proto_depIdxs = []int32{ 1, // 33: proto.Column.null_value:type_name -> proto.NullValue 56, // 34: proto.Column.timestamp_value:type_name -> google.protobuf.Timestamp 2, // 35: proto.ColumnDefinition.type:type_name -> proto.ColumnType - 30, // 36: proto.QueryResult.rows:type_name -> proto.Row - 39, // 37: proto.IndexBucket.items:type_name -> proto.IndexItem - 55, // 38: proto.IndexItem.quals:type_name -> proto.IndexItem.QualsEntry - 56, // 39: proto.IndexItem.insertion_time:type_name -> google.protobuf.Timestamp - 44, // 40: proto.SetRateLimitersRequest.definitions:type_name -> proto.RateLimiterDefinition - 44, // 41: proto.GetRateLimitersResponse.definitions:type_name -> proto.RateLimiterDefinition - 11, // 42: proto.QueryContext.QualsEntry.value:type_name -> proto.Quals - 16, // 43: proto.ExecuteRequest.ExecuteConnectionDataEntry.value:type_name -> proto.ExecuteConnectionData - 35, // 44: proto.Row.ColumnsEntry.value:type_name -> proto.Column - 31, // 45: proto.Schema.SchemaEntry.value:type_name -> proto.TableSchema - 11, // 46: proto.IndexItem.QualsEntry.value:type_name -> proto.Quals - 4, // 47: proto.WrapperPlugin.EstablishMessageStream:input_type -> proto.EstablishMessageStreamRequest - 19, // 48: proto.WrapperPlugin.GetSchema:input_type -> proto.GetSchemaRequest - 15, // 49: proto.WrapperPlugin.Execute:input_type -> proto.ExecuteRequest - 23, // 50: proto.WrapperPlugin.SetConnectionConfig:input_type -> proto.SetConnectionConfigRequest - 25, // 51: proto.WrapperPlugin.SetAllConnectionConfigs:input_type -> proto.SetAllConnectionConfigsRequest - 26, // 52: proto.WrapperPlugin.UpdateConnectionConfigs:input_type -> proto.UpdateConnectionConfigsRequest - 21, // 53: proto.WrapperPlugin.GetSupportedOperations:input_type -> proto.GetSupportedOperationsRequest - 40, // 54: proto.WrapperPlugin.SetCacheOptions:input_type -> proto.SetCacheOptionsRequest - 45, // 55: proto.WrapperPlugin.SetRateLimiters:input_type -> proto.SetRateLimitersRequest - 47, // 56: proto.WrapperPlugin.GetRateLimiters:input_type -> proto.GetRateLimitersRequest - 42, // 57: proto.WrapperPlugin.SetConnectionCacheOptions:input_type -> proto.SetConnectionCacheOptionsRequest - 5, // 58: proto.WrapperPlugin.EstablishMessageStream:output_type -> proto.PluginMessage - 20, // 59: proto.WrapperPlugin.GetSchema:output_type -> proto.GetSchemaResponse - 17, // 60: proto.WrapperPlugin.Execute:output_type -> proto.ExecuteResponse - 28, // 61: proto.WrapperPlugin.SetConnectionConfig:output_type -> proto.SetConnectionConfigResponse - 28, // 62: proto.WrapperPlugin.SetAllConnectionConfigs:output_type -> proto.SetConnectionConfigResponse - 29, // 63: proto.WrapperPlugin.UpdateConnectionConfigs:output_type -> proto.UpdateConnectionConfigsResponse - 22, // 64: proto.WrapperPlugin.GetSupportedOperations:output_type -> proto.GetSupportedOperationsResponse - 41, // 65: proto.WrapperPlugin.SetCacheOptions:output_type -> proto.SetCacheOptionsResponse - 46, // 66: proto.WrapperPlugin.SetRateLimiters:output_type -> proto.SetRateLimitersResponse - 48, // 67: proto.WrapperPlugin.GetRateLimiters:output_type -> proto.GetRateLimitersResponse - 43, // 68: proto.WrapperPlugin.SetConnectionCacheOptions:output_type -> proto.SetConnectionCacheOptionsResponse - 58, // [58:69] is the sub-list for method output_type - 47, // [47:58] is the sub-list for method input_type - 47, // [47:47] is the sub-list for extension type_name - 47, // [47:47] is the sub-list for extension extendee - 0, // [0:47] is the sub-list for field type_name + 35, // 36: proto.ColumnDefinition.default:type_name -> proto.Column + 30, // 37: proto.QueryResult.rows:type_name -> proto.Row + 39, // 38: proto.IndexBucket.items:type_name -> proto.IndexItem + 55, // 39: proto.IndexItem.quals:type_name -> proto.IndexItem.QualsEntry + 56, // 40: proto.IndexItem.insertion_time:type_name -> google.protobuf.Timestamp + 44, // 41: proto.SetRateLimitersRequest.definitions:type_name -> proto.RateLimiterDefinition + 44, // 42: proto.GetRateLimitersResponse.definitions:type_name -> proto.RateLimiterDefinition + 11, // 43: proto.QueryContext.QualsEntry.value:type_name -> proto.Quals + 16, // 44: proto.ExecuteRequest.ExecuteConnectionDataEntry.value:type_name -> proto.ExecuteConnectionData + 35, // 45: proto.Row.ColumnsEntry.value:type_name -> proto.Column + 31, // 46: proto.Schema.SchemaEntry.value:type_name -> proto.TableSchema + 11, // 47: proto.IndexItem.QualsEntry.value:type_name -> proto.Quals + 4, // 48: proto.WrapperPlugin.EstablishMessageStream:input_type -> proto.EstablishMessageStreamRequest + 19, // 49: proto.WrapperPlugin.GetSchema:input_type -> proto.GetSchemaRequest + 15, // 50: proto.WrapperPlugin.Execute:input_type -> proto.ExecuteRequest + 23, // 51: proto.WrapperPlugin.SetConnectionConfig:input_type -> proto.SetConnectionConfigRequest + 25, // 52: proto.WrapperPlugin.SetAllConnectionConfigs:input_type -> proto.SetAllConnectionConfigsRequest + 26, // 53: proto.WrapperPlugin.UpdateConnectionConfigs:input_type -> proto.UpdateConnectionConfigsRequest + 21, // 54: proto.WrapperPlugin.GetSupportedOperations:input_type -> proto.GetSupportedOperationsRequest + 40, // 55: proto.WrapperPlugin.SetCacheOptions:input_type -> proto.SetCacheOptionsRequest + 45, // 56: proto.WrapperPlugin.SetRateLimiters:input_type -> proto.SetRateLimitersRequest + 47, // 57: proto.WrapperPlugin.GetRateLimiters:input_type -> proto.GetRateLimitersRequest + 42, // 58: proto.WrapperPlugin.SetConnectionCacheOptions:input_type -> proto.SetConnectionCacheOptionsRequest + 5, // 59: proto.WrapperPlugin.EstablishMessageStream:output_type -> proto.PluginMessage + 20, // 60: proto.WrapperPlugin.GetSchema:output_type -> proto.GetSchemaResponse + 17, // 61: proto.WrapperPlugin.Execute:output_type -> proto.ExecuteResponse + 28, // 62: proto.WrapperPlugin.SetConnectionConfig:output_type -> proto.SetConnectionConfigResponse + 28, // 63: proto.WrapperPlugin.SetAllConnectionConfigs:output_type -> proto.SetConnectionConfigResponse + 29, // 64: proto.WrapperPlugin.UpdateConnectionConfigs:output_type -> proto.UpdateConnectionConfigsResponse + 22, // 65: proto.WrapperPlugin.GetSupportedOperations:output_type -> proto.GetSupportedOperationsResponse + 41, // 66: proto.WrapperPlugin.SetCacheOptions:output_type -> proto.SetCacheOptionsResponse + 46, // 67: proto.WrapperPlugin.SetRateLimiters:output_type -> proto.SetRateLimitersResponse + 48, // 68: proto.WrapperPlugin.GetRateLimiters:output_type -> proto.GetRateLimitersResponse + 43, // 69: proto.WrapperPlugin.SetConnectionCacheOptions:output_type -> proto.SetConnectionCacheOptionsResponse + 59, // [59:70] is the sub-list for method output_type + 48, // [48:59] is the sub-list for method input_type + 48, // [48:48] is the sub-list for extension type_name + 48, // [48:48] is the sub-list for extension extendee + 0, // [0:48] is the sub-list for field type_name } func init() { file_plugin_proto_init() } diff --git a/grpc/proto/plugin.proto b/grpc/proto/plugin.proto index bbaa94f2..f6841263 100644 --- a/grpc/proto/plugin.proto +++ b/grpc/proto/plugin.proto @@ -262,6 +262,8 @@ message ColumnDefinition { string name = 1; ColumnType type = 2; string description = 3; + string hydrate = 4; + Column default = 5; } enum ColumnType { diff --git a/grpc/proto/table_schema.go b/grpc/proto/table_schema.go index c5606072..81508e76 100644 --- a/grpc/proto/table_schema.go +++ b/grpc/proto/table_schema.go @@ -11,6 +11,22 @@ func (x *TableSchema) GetColumnMap() map[string]*ColumnDefinition { return nil } +func (x *TableSchema) GetKeyColumnMap() map[string]*KeyColumn { + var res = make(map[string]*KeyColumn) + for _, k := range x.GetCallKeyColumnList { + res[k.Name] = k + } + return res +} + +func (x *TableSchema) ListKeyColumnMap() map[string]*KeyColumn { + var res = make(map[string]*KeyColumn) + for _, k := range x.ListCallKeyColumnList { + res[k.Name] = k + } + return res +} + func (x *TableSchema) Equals(other *TableSchema) bool { return !x.Diff(other).HasDiffs() } diff --git a/plugin/column.go b/plugin/column.go index 573d9b4b..f9bae9bc 100644 --- a/plugin/column.go +++ b/plugin/column.go @@ -1,8 +1,15 @@ package plugin import ( + "encoding/json" + "fmt" + "github.com/golang/protobuf/ptypes" + "github.com/turbot/go-kit/helpers" + "github.com/turbot/go-kit/types" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform" + "log" + "net" ) /* @@ -84,6 +91,131 @@ type QueryColumn struct { hydrateName string } +// ToColumnValue converts a value of unknown type to a valid protobuf column value.type +func (c Column) ToColumnValue(val any) (*proto.Column, error) { + defer func() { + if r := recover(); r != nil { + panic(fmt.Errorf("%s: %v", c.Name, r)) + } + }() + + // if the value is a pointer, get its value and use that + val = helpers.DereferencePointer(val) + if val == nil { + if c.Default != nil { + val = c.Default + } else { + // return nil + return &proto.Column{Value: &proto.Column_NullValue{}}, nil + } + } + + var columnValue *proto.Column + + switch c.Type { + case proto.ColumnType_STRING: + columnValue = &proto.Column{Value: &proto.Column_StringValue{StringValue: types.ToString(val)}} + break + case proto.ColumnType_BOOL: + b, err := types.ToBool(val) + if err != nil { + return nil, fmt.Errorf("interfaceToColumnValue failed for column '%s': %v", c.Name, err) + } + columnValue = &proto.Column{Value: &proto.Column_BoolValue{BoolValue: b}} + break + case proto.ColumnType_INT: + i, err := types.ToInt64(val) + if err != nil { + return nil, fmt.Errorf("interfaceToColumnValue failed for column '%s': %v", c.Name, err) + } + + columnValue = &proto.Column{Value: &proto.Column_IntValue{IntValue: i}} + break + case proto.ColumnType_DOUBLE: + d, err := types.ToFloat64(val) + if err != nil { + return nil, fmt.Errorf("interfaceToColumnValue failed for column '%s': %v", c.Name, err) + } + columnValue = &proto.Column{Value: &proto.Column_DoubleValue{DoubleValue: d}} + break + case proto.ColumnType_JSON: + strValue, ok := val.(string) + if ok { + // NOTE: Strings are assumed to be raw JSON, so are passed through directly. + // This is the most common case, but means it's currently impossible to + // pass through a string and have it marshalled to be a JSON representation + // of a string. + columnValue = &proto.Column{Value: &proto.Column_JsonValue{JsonValue: []byte(strValue)}} + } else { + res, err := json.Marshal(val) + if err != nil { + log.Printf("[ERROR] failed to marshal value to json: %v\n", err) + return nil, fmt.Errorf("%s: %v ", c.Name, err) + } + columnValue = &proto.Column{Value: &proto.Column_JsonValue{JsonValue: res}} + } + case proto.ColumnType_DATETIME, proto.ColumnType_TIMESTAMP: + // cast val to time + var timeVal, err = types.ToTime(val) + if err != nil { + return nil, fmt.Errorf("interfaceToColumnValue failed for column '%s': %v", c.Name, err) + } + // now convert time to protobuf timestamp + timestamp, err := ptypes.TimestampProto(timeVal) + if err != nil { + return nil, fmt.Errorf("interfaceToColumnValue failed for column '%s': %v", c.Name, err) + } + columnValue = &proto.Column{Value: &proto.Column_TimestampValue{TimestampValue: timestamp}} + break + case proto.ColumnType_IPADDR: + ipString := types.SafeString(val) + // treat an empty string as a null ip address + if ipString == "" { + columnValue = &proto.Column{Value: &proto.Column_NullValue{}} + } else { + if ip := net.ParseIP(ipString); ip == nil { + return nil, fmt.Errorf("%s: invalid ip address %s", c.Name, ipString) + } + columnValue = &proto.Column{Value: &proto.Column_IpAddrValue{IpAddrValue: ipString}} + } + break + case proto.ColumnType_CIDR: + cidrRangeString := types.SafeString(val) + // treat an empty string as a null ip address + if cidrRangeString == "" { + columnValue = &proto.Column{Value: &proto.Column_NullValue{}} + } else { + if _, _, err := net.ParseCIDR(cidrRangeString); err != nil { + return nil, fmt.Errorf("%s: invalid ip address %s", c.Name, cidrRangeString) + } + columnValue = &proto.Column{Value: &proto.Column_CidrRangeValue{CidrRangeValue: cidrRangeString}} + } + break + case proto.ColumnType_INET: + inetString := types.SafeString(val) + // treat an empty string as a null ip address + if inetString == "" { + columnValue = &proto.Column{Value: &proto.Column_NullValue{}} + } else { + if ip := net.ParseIP(inetString); ip == nil { + if _, _, err := net.ParseCIDR(inetString); err != nil { + return nil, fmt.Errorf("%s: invalid ip address %s", c.Name, inetString) + } + } + columnValue = &proto.Column{Value: &proto.Column_CidrRangeValue{CidrRangeValue: inetString}} + } + case proto.ColumnType_LTREE: + columnValue = &proto.Column{Value: &proto.Column_LtreeValue{LtreeValue: types.ToString(val)}} + break + + default: + return nil, fmt.Errorf("unrecognised columnValue type '%s'", c.Type) + } + + return columnValue, nil + +} + func NewQueryColumn(column *Column, hydrateName string) *QueryColumn { return &QueryColumn{column, hydrateName} } diff --git a/plugin/table_column.go b/plugin/table_column.go index 90020a31..07470649 100644 --- a/plugin/table_column.go +++ b/plugin/table_column.go @@ -2,16 +2,11 @@ package plugin import ( "context" - "encoding/json" "fmt" - "log" - "net" - - "github.com/golang/protobuf/ptypes" "github.com/turbot/go-kit/helpers" - "github.com/turbot/go-kit/types" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform" + "log" ) // get the column object with the given name @@ -61,7 +56,8 @@ func (t *Table) getColumnValue(ctx context.Context, rowData *rowData, column *Qu } } // now convert the value to a protobuf column value - c, err := t.interfaceToColumnValue(column, value) + c, err := column.ToColumnValue(value) + //c, err := proto.InterfaceToColumnValue(column.Column.Name, column.Column.Type, column.Column.Default, value) return c, err } @@ -90,128 +86,3 @@ func (t *Table) getDefaultColumnTransform(column *QueryColumn) *transform.Column } return columnTransform } - -// convert a value of unknown type to a valid protobuf column value.type -func (t *Table) interfaceToColumnValue(column *QueryColumn, val interface{}) (*proto.Column, error) { - defer func() { - if r := recover(); r != nil { - panic(fmt.Errorf("%s: %v", column.Name, r)) - } - }() - - // if the value is a pointer, get its value and use that - val = helpers.DereferencePointer(val) - if val == nil { - if column.Default != nil { - val = column.Default - } else { - // return nil - return &proto.Column{Value: &proto.Column_NullValue{}}, nil - } - } - - var columnValue *proto.Column - - switch column.Type { - case proto.ColumnType_STRING: - columnValue = &proto.Column{Value: &proto.Column_StringValue{StringValue: types.ToString(val)}} - break - case proto.ColumnType_BOOL: - b, err := types.ToBool(val) - if err != nil { - return nil, fmt.Errorf("interfaceToColumnValue failed for column '%s': %v", column.Name, err) - } - columnValue = &proto.Column{Value: &proto.Column_BoolValue{BoolValue: b}} - break - case proto.ColumnType_INT: - i, err := types.ToInt64(val) - if err != nil { - return nil, fmt.Errorf("interfaceToColumnValue failed for column '%s': %v", column.Name, err) - } - - columnValue = &proto.Column{Value: &proto.Column_IntValue{IntValue: i}} - break - case proto.ColumnType_DOUBLE: - d, err := types.ToFloat64(val) - if err != nil { - return nil, fmt.Errorf("interfaceToColumnValue failed for column '%s': %v", column.Name, err) - } - columnValue = &proto.Column{Value: &proto.Column_DoubleValue{DoubleValue: d}} - break - case proto.ColumnType_JSON: - strValue, ok := val.(string) - if ok { - // NOTE: Strings are assumed to be raw JSON, so are passed through directly. - // This is the most common case, but means it's currently impossible to - // pass through a string and have it marshalled to be a JSON representation - // of a string. - columnValue = &proto.Column{Value: &proto.Column_JsonValue{JsonValue: []byte(strValue)}} - } else { - res, err := json.Marshal(val) - if err != nil { - log.Printf("[ERROR] failed to marshal value to json: %v\n", err) - return nil, fmt.Errorf("%s: %v ", column.Name, err) - } - columnValue = &proto.Column{Value: &proto.Column_JsonValue{JsonValue: res}} - } - case proto.ColumnType_DATETIME, proto.ColumnType_TIMESTAMP: - // cast val to time - var timeVal, err = types.ToTime(val) - if err != nil { - return nil, fmt.Errorf("interfaceToColumnValue failed for column '%s': %v", column.Name, err) - } - // now convert time to protobuf timestamp - timestamp, err := ptypes.TimestampProto(timeVal) - if err != nil { - return nil, fmt.Errorf("interfaceToColumnValue failed for column '%s': %v", column.Name, err) - } - columnValue = &proto.Column{Value: &proto.Column_TimestampValue{TimestampValue: timestamp}} - break - case proto.ColumnType_IPADDR: - ipString := types.SafeString(val) - // treat an empty string as a null ip address - if ipString == "" { - columnValue = &proto.Column{Value: &proto.Column_NullValue{}} - } else { - if ip := net.ParseIP(ipString); ip == nil { - return nil, fmt.Errorf("%s: invalid ip address %s", column.Name, ipString) - } - columnValue = &proto.Column{Value: &proto.Column_IpAddrValue{IpAddrValue: ipString}} - } - break - case proto.ColumnType_CIDR: - cidrRangeString := types.SafeString(val) - // treat an empty string as a null ip address - if cidrRangeString == "" { - columnValue = &proto.Column{Value: &proto.Column_NullValue{}} - } else { - if _, _, err := net.ParseCIDR(cidrRangeString); err != nil { - return nil, fmt.Errorf("%s: invalid ip address %s", column.Name, cidrRangeString) - } - columnValue = &proto.Column{Value: &proto.Column_CidrRangeValue{CidrRangeValue: cidrRangeString}} - } - break - case proto.ColumnType_INET: - inetString := types.SafeString(val) - // treat an empty string as a null ip address - if inetString == "" { - columnValue = &proto.Column{Value: &proto.Column_NullValue{}} - } else { - if ip := net.ParseIP(inetString); ip == nil { - if _, _, err := net.ParseCIDR(inetString); err != nil { - return nil, fmt.Errorf("%s: invalid ip address %s", column.Name, inetString) - } - } - columnValue = &proto.Column{Value: &proto.Column_CidrRangeValue{CidrRangeValue: inetString}} - } - case proto.ColumnType_LTREE: - columnValue = &proto.Column{Value: &proto.Column_LtreeValue{LtreeValue: types.ToString(val)}} - break - - default: - return nil, fmt.Errorf("unrecognised columnValue type '%s'", column.Type) - } - - return columnValue, nil - -} diff --git a/plugin/table_schema.go b/plugin/table_schema.go index 43ccdf2a..33bd3c04 100644 --- a/plugin/table_schema.go +++ b/plugin/table_schema.go @@ -1,6 +1,7 @@ package plugin import ( + "github.com/turbot/go-kit/helpers" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "strings" ) @@ -41,6 +42,20 @@ func (t *Table) GetSchema() (*proto.TableSchema, error) { Type: column.Type, Description: column.Description, } + if column.Hydrate != nil { + name, _ := column.Hydrate.getOriginalFuncName() + columnDef.Hydrate = name + } + if !helpers.IsNil(column.Default) { + // to convert the column default to a proto.Column, call ToColumnValue with a nil value + // - we will get the default + def, err := column.ToColumnValue(nil) + if err != nil { + return nil, err + } + columnDef.Default = def + + } schema.Columns = append(schema.Columns, columnDef) } }