feat: add GRPC unary call service to our GreptimeDB (#15)

* feat: add GRPC unary call service to our GreptimeDB

* feat: add GRPC unary call service to our GreptimeDB

* feat: add GRPC unary call service to our GreptimeDB
This commit is contained in:
LFC
2023-03-17 16:29:30 +08:00
committed by GitHub
parent 3a71515056
commit 0a7b790ed4
5 changed files with 7447 additions and 891 deletions
+249 -86
View File
@@ -372,6 +372,119 @@ func (*GreptimeRequest_Query) isGreptimeRequest_Request() {}
func (*GreptimeRequest_Ddl) isGreptimeRequest_Request() {}
type ResponseHeader struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *ResponseHeader) Reset() {
*x = ResponseHeader{}
if protoimpl.UnsafeEnabled {
mi := &file_greptime_v1_database_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ResponseHeader) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ResponseHeader) ProtoMessage() {}
func (x *ResponseHeader) ProtoReflect() protoreflect.Message {
mi := &file_greptime_v1_database_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ResponseHeader.ProtoReflect.Descriptor instead.
func (*ResponseHeader) Descriptor() ([]byte, []int) {
return file_greptime_v1_database_proto_rawDescGZIP(), []int{5}
}
type GreptimeResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
// Types that are assignable to Response:
//
// *GreptimeResponse_AffectedRows
Response isGreptimeResponse_Response `protobuf_oneof:"response"`
}
func (x *GreptimeResponse) Reset() {
*x = GreptimeResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_greptime_v1_database_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GreptimeResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GreptimeResponse) ProtoMessage() {}
func (x *GreptimeResponse) ProtoReflect() protoreflect.Message {
mi := &file_greptime_v1_database_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GreptimeResponse.ProtoReflect.Descriptor instead.
func (*GreptimeResponse) Descriptor() ([]byte, []int) {
return file_greptime_v1_database_proto_rawDescGZIP(), []int{6}
}
func (x *GreptimeResponse) GetHeader() *ResponseHeader {
if x != nil {
return x.Header
}
return nil
}
func (m *GreptimeResponse) GetResponse() isGreptimeResponse_Response {
if m != nil {
return m.Response
}
return nil
}
func (x *GreptimeResponse) GetAffectedRows() *AffectedRows {
if x, ok := x.GetResponse().(*GreptimeResponse_AffectedRows); ok {
return x.AffectedRows
}
return nil
}
type isGreptimeResponse_Response interface {
isGreptimeResponse_Response()
}
type GreptimeResponse_AffectedRows struct {
AffectedRows *AffectedRows `protobuf:"bytes,2,opt,name=affected_rows,json=affectedRows,proto3,oneof"`
}
func (*GreptimeResponse_AffectedRows) isGreptimeResponse_Response() {}
type QueryRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -388,7 +501,7 @@ type QueryRequest struct {
func (x *QueryRequest) Reset() {
*x = QueryRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_greptime_v1_database_proto_msgTypes[5]
mi := &file_greptime_v1_database_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -401,7 +514,7 @@ func (x *QueryRequest) String() string {
func (*QueryRequest) ProtoMessage() {}
func (x *QueryRequest) ProtoReflect() protoreflect.Message {
mi := &file_greptime_v1_database_proto_msgTypes[5]
mi := &file_greptime_v1_database_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -414,7 +527,7 @@ func (x *QueryRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.
func (*QueryRequest) Descriptor() ([]byte, []int) {
return file_greptime_v1_database_proto_rawDescGZIP(), []int{5}
return file_greptime_v1_database_proto_rawDescGZIP(), []int{7}
}
func (m *QueryRequest) GetQuery() isQueryRequest_Query {
@@ -481,7 +594,7 @@ type PromRangeQuery struct {
func (x *PromRangeQuery) Reset() {
*x = PromRangeQuery{}
if protoimpl.UnsafeEnabled {
mi := &file_greptime_v1_database_proto_msgTypes[6]
mi := &file_greptime_v1_database_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -494,7 +607,7 @@ func (x *PromRangeQuery) String() string {
func (*PromRangeQuery) ProtoMessage() {}
func (x *PromRangeQuery) ProtoReflect() protoreflect.Message {
mi := &file_greptime_v1_database_proto_msgTypes[6]
mi := &file_greptime_v1_database_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -507,7 +620,7 @@ func (x *PromRangeQuery) ProtoReflect() protoreflect.Message {
// Deprecated: Use PromRangeQuery.ProtoReflect.Descriptor instead.
func (*PromRangeQuery) Descriptor() ([]byte, []int) {
return file_greptime_v1_database_proto_rawDescGZIP(), []int{6}
return file_greptime_v1_database_proto_rawDescGZIP(), []int{8}
}
func (x *PromRangeQuery) GetQuery() string {
@@ -557,7 +670,7 @@ type InsertRequest struct {
func (x *InsertRequest) Reset() {
*x = InsertRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_greptime_v1_database_proto_msgTypes[7]
mi := &file_greptime_v1_database_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -570,7 +683,7 @@ func (x *InsertRequest) String() string {
func (*InsertRequest) ProtoMessage() {}
func (x *InsertRequest) ProtoReflect() protoreflect.Message {
mi := &file_greptime_v1_database_proto_msgTypes[7]
mi := &file_greptime_v1_database_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -583,7 +696,7 @@ func (x *InsertRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use InsertRequest.ProtoReflect.Descriptor instead.
func (*InsertRequest) Descriptor() ([]byte, []int) {
return file_greptime_v1_database_proto_rawDescGZIP(), []int{7}
return file_greptime_v1_database_proto_rawDescGZIP(), []int{9}
}
func (x *InsertRequest) GetTableName() string {
@@ -625,7 +738,7 @@ type AffectedRows struct {
func (x *AffectedRows) Reset() {
*x = AffectedRows{}
if protoimpl.UnsafeEnabled {
mi := &file_greptime_v1_database_proto_msgTypes[8]
mi := &file_greptime_v1_database_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -638,7 +751,7 @@ func (x *AffectedRows) String() string {
func (*AffectedRows) ProtoMessage() {}
func (x *AffectedRows) ProtoReflect() protoreflect.Message {
mi := &file_greptime_v1_database_proto_msgTypes[8]
mi := &file_greptime_v1_database_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -651,7 +764,7 @@ func (x *AffectedRows) ProtoReflect() protoreflect.Message {
// Deprecated: Use AffectedRows.ProtoReflect.Descriptor instead.
func (*AffectedRows) Descriptor() ([]byte, []int) {
return file_greptime_v1_database_proto_rawDescGZIP(), []int{8}
return file_greptime_v1_database_proto_rawDescGZIP(), []int{10}
}
func (x *AffectedRows) GetValue() uint32 {
@@ -672,7 +785,7 @@ type FlightMetadata struct {
func (x *FlightMetadata) Reset() {
*x = FlightMetadata{}
if protoimpl.UnsafeEnabled {
mi := &file_greptime_v1_database_proto_msgTypes[9]
mi := &file_greptime_v1_database_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -685,7 +798,7 @@ func (x *FlightMetadata) String() string {
func (*FlightMetadata) ProtoMessage() {}
func (x *FlightMetadata) ProtoReflect() protoreflect.Message {
mi := &file_greptime_v1_database_proto_msgTypes[9]
mi := &file_greptime_v1_database_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -698,7 +811,7 @@ func (x *FlightMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use FlightMetadata.ProtoReflect.Descriptor instead.
func (*FlightMetadata) Descriptor() ([]byte, []int) {
return file_greptime_v1_database_proto_rawDescGZIP(), []int{9}
return file_greptime_v1_database_proto_rawDescGZIP(), []int{11}
}
func (x *FlightMetadata) GetAffectedRows() *AffectedRows {
@@ -752,46 +865,63 @@ var file_greptime_v1_database_proto_rawDesc = []byte{
0x65, 0x72, 0x79, 0x12, 0x2b, 0x0a, 0x03, 0x64, 0x64, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x17, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44,
0x64, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x03, 0x64, 0x64, 0x6c,
0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x99, 0x01, 0x0a, 0x0c,
0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x03,
0x73, 0x71, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x73, 0x71, 0x6c,
0x12, 0x23, 0x0a, 0x0c, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x70, 0x6c, 0x61, 0x6e,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0b, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x61,
0x6c, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x47, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x6d, 0x5f, 0x72, 0x61,
0x6e, 0x67, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x1b, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72,
0x6f, 0x6d, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0e,
0x70, 0x72, 0x6f, 0x6d, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x07,
0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x62, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x6d, 0x52,
0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65,
0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12,
0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x22, 0x9f, 0x01, 0x0a, 0x0d,
0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a,
0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x07,
0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e,
0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x75,
0x6d, 0x6e, 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x72,
0x6f, 0x77, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08,
0x72, 0x6f, 0x77, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x67, 0x69,
0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52,
0x0c, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x24, 0x0a,
0x0c, 0x41, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x14, 0x0a,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x22, 0x50, 0x0a, 0x0e, 0x46, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x4d, 0x65, 0x74,
0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3e, 0x0a, 0x0d, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65,
0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67,
0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x66, 0x66, 0x65, 0x63,
0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x52, 0x0c, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65,
0x64, 0x52, 0x6f, 0x77, 0x73, 0x42, 0x51, 0x0a, 0x0e, 0x69, 0x6f, 0x2e, 0x67, 0x72, 0x65, 0x70,
0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
0x65, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x72,
0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x2f, 0x67, 0x72, 0x65, 0x70, 0x74,
0x69, 0x6d, 0x65, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x65,
0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x10, 0x0a, 0x0e, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x95, 0x01,
0x0a, 0x10, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31,
0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52,
0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x0d, 0x61, 0x66, 0x66, 0x65, 0x63,
0x74, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19,
0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x66, 0x66,
0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x61, 0x66, 0x66,
0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x99, 0x01, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x03, 0x73, 0x71, 0x6c, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x73, 0x71, 0x6c, 0x12, 0x23, 0x0a, 0x0c, 0x6c, 0x6f,
0x67, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c,
0x48, 0x00, 0x52, 0x0b, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x61, 0x6c, 0x50, 0x6c, 0x61, 0x6e, 0x12,
0x47, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x6d, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x71, 0x75,
0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x72, 0x65, 0x70,
0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x52, 0x61, 0x6e, 0x67,
0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x6d, 0x52, 0x61,
0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72,
0x79, 0x22, 0x62, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x6d, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75,
0x65, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61,
0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12,
0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x6e,
0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x73, 0x74, 0x65, 0x70, 0x22, 0x9f, 0x01, 0x0a, 0x0d, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65,
0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x62,
0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e,
0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69,
0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x52, 0x07, 0x63, 0x6f,
0x6c, 0x75, 0x6d, 0x6e, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x77, 0x5f, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x6f, 0x77, 0x43, 0x6f, 0x75,
0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d,
0x62, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x6f,
0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x24, 0x0a, 0x0c, 0x41, 0x66, 0x66, 0x65, 0x63,
0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x50, 0x0a,
0x0e, 0x46, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12,
0x3e, 0x0a, 0x0d, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x77, 0x73,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d,
0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77,
0x73, 0x52, 0x0c, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x77, 0x73, 0x32,
0x59, 0x0a, 0x10, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62,
0x61, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x06, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x1c, 0x2e,
0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x65, 0x70,
0x74, 0x69, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x72,
0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69,
0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x51, 0x0a, 0x0e, 0x69, 0x6f,
0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x44, 0x61,
0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x47, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x2f,
0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67,
0x6f, 0x2f, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -806,37 +936,43 @@ func file_greptime_v1_database_proto_rawDescGZIP() []byte {
return file_greptime_v1_database_proto_rawDescData
}
var file_greptime_v1_database_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_greptime_v1_database_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
var file_greptime_v1_database_proto_goTypes = []interface{}{
(*RequestHeader)(nil), // 0: greptime.v1.RequestHeader
(*AuthHeader)(nil), // 1: greptime.v1.AuthHeader
(*Basic)(nil), // 2: greptime.v1.Basic
(*Token)(nil), // 3: greptime.v1.Token
(*GreptimeRequest)(nil), // 4: greptime.v1.GreptimeRequest
(*QueryRequest)(nil), // 5: greptime.v1.QueryRequest
(*PromRangeQuery)(nil), // 6: greptime.v1.PromRangeQuery
(*InsertRequest)(nil), // 7: greptime.v1.InsertRequest
(*AffectedRows)(nil), // 8: greptime.v1.AffectedRows
(*FlightMetadata)(nil), // 9: greptime.v1.FlightMetadata
(*DdlRequest)(nil), // 10: greptime.v1.DdlRequest
(*Column)(nil), // 11: greptime.v1.Column
(*RequestHeader)(nil), // 0: greptime.v1.RequestHeader
(*AuthHeader)(nil), // 1: greptime.v1.AuthHeader
(*Basic)(nil), // 2: greptime.v1.Basic
(*Token)(nil), // 3: greptime.v1.Token
(*GreptimeRequest)(nil), // 4: greptime.v1.GreptimeRequest
(*ResponseHeader)(nil), // 5: greptime.v1.ResponseHeader
(*GreptimeResponse)(nil), // 6: greptime.v1.GreptimeResponse
(*QueryRequest)(nil), // 7: greptime.v1.QueryRequest
(*PromRangeQuery)(nil), // 8: greptime.v1.PromRangeQuery
(*InsertRequest)(nil), // 9: greptime.v1.InsertRequest
(*AffectedRows)(nil), // 10: greptime.v1.AffectedRows
(*FlightMetadata)(nil), // 11: greptime.v1.FlightMetadata
(*DdlRequest)(nil), // 12: greptime.v1.DdlRequest
(*Column)(nil), // 13: greptime.v1.Column
}
var file_greptime_v1_database_proto_depIdxs = []int32{
1, // 0: greptime.v1.RequestHeader.authorization:type_name -> greptime.v1.AuthHeader
2, // 1: greptime.v1.AuthHeader.basic:type_name -> greptime.v1.Basic
3, // 2: greptime.v1.AuthHeader.token:type_name -> greptime.v1.Token
0, // 3: greptime.v1.GreptimeRequest.header:type_name -> greptime.v1.RequestHeader
7, // 4: greptime.v1.GreptimeRequest.insert:type_name -> greptime.v1.InsertRequest
5, // 5: greptime.v1.GreptimeRequest.query:type_name -> greptime.v1.QueryRequest
10, // 6: greptime.v1.GreptimeRequest.ddl:type_name -> greptime.v1.DdlRequest
6, // 7: greptime.v1.QueryRequest.prom_range_query:type_name -> greptime.v1.PromRangeQuery
11, // 8: greptime.v1.InsertRequest.columns:type_name -> greptime.v1.Column
8, // 9: greptime.v1.FlightMetadata.affected_rows:type_name -> greptime.v1.AffectedRows
10, // [10:10] is the sub-list for method output_type
10, // [10:10] is the sub-list for method input_type
10, // [10:10] is the sub-list for extension type_name
10, // [10:10] is the sub-list for extension extendee
0, // [0:10] is the sub-list for field type_name
9, // 4: greptime.v1.GreptimeRequest.insert:type_name -> greptime.v1.InsertRequest
7, // 5: greptime.v1.GreptimeRequest.query:type_name -> greptime.v1.QueryRequest
12, // 6: greptime.v1.GreptimeRequest.ddl:type_name -> greptime.v1.DdlRequest
5, // 7: greptime.v1.GreptimeResponse.header:type_name -> greptime.v1.ResponseHeader
10, // 8: greptime.v1.GreptimeResponse.affected_rows:type_name -> greptime.v1.AffectedRows
8, // 9: greptime.v1.QueryRequest.prom_range_query:type_name -> greptime.v1.PromRangeQuery
13, // 10: greptime.v1.InsertRequest.columns:type_name -> greptime.v1.Column
10, // 11: greptime.v1.FlightMetadata.affected_rows:type_name -> greptime.v1.AffectedRows
4, // 12: greptime.v1.GreptimeDatabase.Handle:input_type -> greptime.v1.GreptimeRequest
6, // 13: greptime.v1.GreptimeDatabase.Handle:output_type -> greptime.v1.GreptimeResponse
13, // [13:14] is the sub-list for method output_type
12, // [12:13] is the sub-list for method input_type
12, // [12:12] is the sub-list for extension type_name
12, // [12:12] is the sub-list for extension extendee
0, // [0:12] is the sub-list for field type_name
}
func init() { file_greptime_v1_database_proto_init() }
@@ -908,7 +1044,7 @@ func file_greptime_v1_database_proto_init() {
}
}
file_greptime_v1_database_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*QueryRequest); i {
switch v := v.(*ResponseHeader); i {
case 0:
return &v.state
case 1:
@@ -920,7 +1056,7 @@ func file_greptime_v1_database_proto_init() {
}
}
file_greptime_v1_database_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PromRangeQuery); i {
switch v := v.(*GreptimeResponse); i {
case 0:
return &v.state
case 1:
@@ -932,7 +1068,7 @@ func file_greptime_v1_database_proto_init() {
}
}
file_greptime_v1_database_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*InsertRequest); i {
switch v := v.(*QueryRequest); i {
case 0:
return &v.state
case 1:
@@ -944,7 +1080,7 @@ func file_greptime_v1_database_proto_init() {
}
}
file_greptime_v1_database_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AffectedRows); i {
switch v := v.(*PromRangeQuery); i {
case 0:
return &v.state
case 1:
@@ -956,6 +1092,30 @@ func file_greptime_v1_database_proto_init() {
}
}
file_greptime_v1_database_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*InsertRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_greptime_v1_database_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AffectedRows); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_greptime_v1_database_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FlightMetadata); i {
case 0:
return &v.state
@@ -977,7 +1137,10 @@ func file_greptime_v1_database_proto_init() {
(*GreptimeRequest_Query)(nil),
(*GreptimeRequest_Ddl)(nil),
}
file_greptime_v1_database_proto_msgTypes[5].OneofWrappers = []interface{}{
file_greptime_v1_database_proto_msgTypes[6].OneofWrappers = []interface{}{
(*GreptimeResponse_AffectedRows)(nil),
}
file_greptime_v1_database_proto_msgTypes[7].OneofWrappers = []interface{}{
(*QueryRequest_Sql)(nil),
(*QueryRequest_LogicalPlan)(nil),
(*QueryRequest_PromRangeQuery)(nil),
@@ -988,9 +1151,9 @@ func file_greptime_v1_database_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_greptime_v1_database_proto_rawDesc,
NumEnums: 0,
NumMessages: 10,
NumMessages: 12,
NumExtensions: 0,
NumServices: 0,
NumServices: 1,
},
GoTypes: file_greptime_v1_database_proto_goTypes,
DependencyIndexes: file_greptime_v1_database_proto_depIdxs,
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+13
View File
@@ -9,6 +9,10 @@ option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
import "greptime/v1/ddl.proto";
import "greptime/v1/column.proto";
service GreptimeDatabase {
rpc Handle(GreptimeRequest) returns (GreptimeResponse);
}
message RequestHeader {
// The `catalog` that is selected to be used in this request.
string catalog = 1;
@@ -43,6 +47,15 @@ message GreptimeRequest {
}
}
message ResponseHeader {}
message GreptimeResponse {
ResponseHeader header = 1;
oneof response {
AffectedRows affected_rows = 2;
}
}
message QueryRequest {
oneof query {
string sql = 1;