1
0
Fork 0

Reuse existing consistency level

master
Philip O'Toole 1 year ago
parent b94fc3ac2e
commit c23d3e60b1

@ -69,55 +69,6 @@ func (QueryRequest_Level) EnumDescriptor() ([]byte, []int) {
return file_command_proto_rawDescGZIP(), []int{3, 0} return file_command_proto_rawDescGZIP(), []int{3, 0}
} }
type ExecuteQueryRequest_Level int32
const (
ExecuteQueryRequest_QUERY_REQUEST_LEVEL_NONE ExecuteQueryRequest_Level = 0
ExecuteQueryRequest_QUERY_REQUEST_LEVEL_WEAK ExecuteQueryRequest_Level = 1
ExecuteQueryRequest_QUERY_REQUEST_LEVEL_STRONG ExecuteQueryRequest_Level = 2
)
// Enum value maps for ExecuteQueryRequest_Level.
var (
ExecuteQueryRequest_Level_name = map[int32]string{
0: "QUERY_REQUEST_LEVEL_NONE",
1: "QUERY_REQUEST_LEVEL_WEAK",
2: "QUERY_REQUEST_LEVEL_STRONG",
}
ExecuteQueryRequest_Level_value = map[string]int32{
"QUERY_REQUEST_LEVEL_NONE": 0,
"QUERY_REQUEST_LEVEL_WEAK": 1,
"QUERY_REQUEST_LEVEL_STRONG": 2,
}
)
func (x ExecuteQueryRequest_Level) Enum() *ExecuteQueryRequest_Level {
p := new(ExecuteQueryRequest_Level)
*p = x
return p
}
func (x ExecuteQueryRequest_Level) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ExecuteQueryRequest_Level) Descriptor() protoreflect.EnumDescriptor {
return file_command_proto_enumTypes[1].Descriptor()
}
func (ExecuteQueryRequest_Level) Type() protoreflect.EnumType {
return &file_command_proto_enumTypes[1]
}
func (x ExecuteQueryRequest_Level) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ExecuteQueryRequest_Level.Descriptor instead.
func (ExecuteQueryRequest_Level) EnumDescriptor() ([]byte, []int) {
return file_command_proto_rawDescGZIP(), []int{8, 0}
}
type BackupRequest_Format int32 type BackupRequest_Format int32
const ( const (
@ -151,11 +102,11 @@ func (x BackupRequest_Format) String() string {
} }
func (BackupRequest_Format) Descriptor() protoreflect.EnumDescriptor { func (BackupRequest_Format) Descriptor() protoreflect.EnumDescriptor {
return file_command_proto_enumTypes[2].Descriptor() return file_command_proto_enumTypes[1].Descriptor()
} }
func (BackupRequest_Format) Type() protoreflect.EnumType { func (BackupRequest_Format) Type() protoreflect.EnumType {
return &file_command_proto_enumTypes[2] return &file_command_proto_enumTypes[1]
} }
func (x BackupRequest_Format) Number() protoreflect.EnumNumber { func (x BackupRequest_Format) Number() protoreflect.EnumNumber {
@ -212,11 +163,11 @@ func (x Command_Type) String() string {
} }
func (Command_Type) Descriptor() protoreflect.EnumDescriptor { func (Command_Type) Descriptor() protoreflect.EnumDescriptor {
return file_command_proto_enumTypes[3].Descriptor() return file_command_proto_enumTypes[2].Descriptor()
} }
func (Command_Type) Type() protoreflect.EnumType { func (Command_Type) Type() protoreflect.EnumType {
return &file_command_proto_enumTypes[3] return &file_command_proto_enumTypes[2]
} }
func (x Command_Type) Number() protoreflect.EnumNumber { func (x Command_Type) Number() protoreflect.EnumNumber {
@ -797,10 +748,10 @@ type ExecuteQueryRequest struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Request *Request `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` Request *Request `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
Timings bool `protobuf:"varint,2,opt,name=timings,proto3" json:"timings,omitempty"` Timings bool `protobuf:"varint,2,opt,name=timings,proto3" json:"timings,omitempty"`
Level ExecuteQueryRequest_Level `protobuf:"varint,3,opt,name=level,proto3,enum=command.ExecuteQueryRequest_Level" json:"level,omitempty"` Level QueryRequest_Level `protobuf:"varint,3,opt,name=level,proto3,enum=command.QueryRequest_Level" json:"level,omitempty"`
Freshness int64 `protobuf:"varint,4,opt,name=freshness,proto3" json:"freshness,omitempty"` Freshness int64 `protobuf:"varint,4,opt,name=freshness,proto3" json:"freshness,omitempty"`
} }
func (x *ExecuteQueryRequest) Reset() { func (x *ExecuteQueryRequest) Reset() {
@ -849,11 +800,11 @@ func (x *ExecuteQueryRequest) GetTimings() bool {
return false return false
} }
func (x *ExecuteQueryRequest) GetLevel() ExecuteQueryRequest_Level { func (x *ExecuteQueryRequest) GetLevel() QueryRequest_Level {
if x != nil { if x != nil {
return x.Level return x.Level
} }
return ExecuteQueryRequest_QUERY_REQUEST_LEVEL_NONE return QueryRequest_QUERY_REQUEST_LEVEL_NONE
} }
func (x *ExecuteQueryRequest) GetFreshness() int64 { func (x *ExecuteQueryRequest) GetFreshness() int64 {
@ -1402,82 +1353,75 @@ var file_command_proto_rawDesc = []byte{
0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a,
0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, 0x74, 0x69, 0x6d,
0x65, 0x22, 0x98, 0x02, 0x0a, 0x13, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65, 0x65, 0x22, 0xac, 0x01, 0x0a, 0x13, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65,
0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x72, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d,
0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x73, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x73,
0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x73, 0x12,
0x38, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x31, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b,
0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65,
0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x65, 0x76, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x05, 0x6c, 0x65, 0x76,
0x65, 0x6c, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, 0x65, 0x65, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, 0x65, 0x73, 0x68, 0x6e, 0x65, 0x73, 0x73, 0x18,
0x73, 0x68, 0x6e, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x72, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x72, 0x65, 0x73, 0x68, 0x6e, 0x65, 0x73, 0x73,
0x65, 0x73, 0x68, 0x6e, 0x65, 0x73, 0x73, 0x22, 0x63, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x84, 0x01, 0x0a, 0x14, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72,
0x12, 0x1c, 0x0a, 0x18, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x01, 0x71, 0x18, 0x01,
0x54, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x51,
0x0a, 0x18, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x75, 0x65, 0x72, 0x79, 0x52, 0x6f, 0x77, 0x73, 0x48, 0x00, 0x52, 0x01, 0x71, 0x12, 0x26, 0x0a,
0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x57, 0x45, 0x41, 0x4b, 0x10, 0x01, 0x12, 0x1e, 0x0a, 0x1a, 0x01, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61,
0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x4c, 0x45, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x56, 0x45, 0x4c, 0x5f, 0x53, 0x54, 0x52, 0x4f, 0x4e, 0x47, 0x10, 0x02, 0x22, 0x84, 0x01, 0x0a, 0x48, 0x00, 0x52, 0x01, 0x65, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03,
0x14, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x08, 0x0a,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x01, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xc9, 0x01, 0x0a, 0x0d, 0x42, 0x61, 0x63, 0x6b,
0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x06, 0x66, 0x6f, 0x72,
0x52, 0x6f, 0x77, 0x73, 0x48, 0x00, 0x52, 0x01, 0x71, 0x12, 0x26, 0x0a, 0x01, 0x65, 0x18, 0x02, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x61, 0x6e, 0x64, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, 0x01, 0x74, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,
0x65, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x12, 0x16, 0x0a, 0x06, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08,
0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x52, 0x06, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x69, 0x0a, 0x06, 0x46, 0x6f, 0x72, 0x6d,
0x75, 0x6c, 0x74, 0x22, 0xc9, 0x01, 0x0a, 0x0d, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x61, 0x74, 0x12, 0x1e, 0x0a, 0x1a, 0x42, 0x41, 0x43, 0x4b, 0x55, 0x50, 0x5f, 0x52, 0x45, 0x51,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x4e, 0x4f, 0x4e, 0x45,
0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x42, 0x41, 0x43, 0x4b, 0x55, 0x50, 0x5f, 0x52, 0x45, 0x51,
0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x6f, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x53, 0x51, 0x4c, 0x10,
0x72, 0x6d, 0x61, 0x74, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x01, 0x12, 0x20, 0x0a, 0x1c, 0x42, 0x41, 0x43, 0x4b, 0x55, 0x50, 0x5f, 0x52, 0x45, 0x51, 0x55,
0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x4c, 0x65, 0x45, 0x53, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x42, 0x49, 0x4e, 0x41, 0x52,
0x61, 0x64, 0x65, 0x72, 0x22, 0x69, 0x0a, 0x06, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x1e, 0x59, 0x10, 0x02, 0x22, 0x21, 0x0a, 0x0b, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65,
0x0a, 0x1a, 0x42, 0x41, 0x43, 0x4b, 0x55, 0x50, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c,
0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x1d, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x4d, 0x0a, 0x0b, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65,
0x0a, 0x19, 0x42, 0x41, 0x43, 0x4b, 0x55, 0x50, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x53, 0x51, 0x4c, 0x10, 0x01, 0x12, 0x20, 0x0a, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
0x1c, 0x42, 0x41, 0x43, 0x4b, 0x55, 0x50, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12,
0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x02, 0x22, 0x14, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05,
0x21, 0x0a, 0x0b, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x22, 0x39, 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52,
0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x74, 0x61, 0x22, 0x4d, 0x0a, 0x0b, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73,
0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
0x64, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x22, 0x23, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65,
0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x6f, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x16, 0x0a, 0x04, 0x4e, 0x6f, 0x6f, 0x70, 0x12, 0x0e, 0x0a,
0x72, 0x22, 0x39, 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0xaf, 0x02,
0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x79, 0x70,
0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x23, 0x0a, 0x11, 0x64, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04,
0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x63, 0x6f, 0x6d, 0x6d,
0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x43, 0x6f,
0x64, 0x22, 0x16, 0x0a, 0x04, 0x4e, 0x6f, 0x6f, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0xaf, 0x02, 0x0a, 0x07, 0x43, 0x6f, 0x73, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x72,
0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x65, 0x73, 0x73, 0x65, 0x64, 0x22, 0xb7, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18,
0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x43, 0x6f, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55,
0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4f, 0x4d, 0x4d,
0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x01,
0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45,
0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x18, 0x5f, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x45, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f,
0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x4f, 0x4f, 0x50, 0x10,
0x64, 0x22, 0xb7, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50,
0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x45, 0x5f, 0x4c, 0x4f, 0x41, 0x44, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, 0x4d,
0x57, 0x4e, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4a, 0x4f, 0x49, 0x4e, 0x10, 0x05, 0x12,
0x54, 0x59, 0x50, 0x45, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x1e, 0x0a, 0x1a, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x45, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x45, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x06, 0x42,
0x43, 0x55, 0x54, 0x45, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x22, 0x5a, 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x71,
0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x4f, 0x4f, 0x50, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x6c, 0x69, 0x74, 0x65, 0x2f, 0x72, 0x71, 0x6c, 0x69, 0x74, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d,
0x11, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x61, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x41, 0x44, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f,
0x54, 0x59, 0x50, 0x45, 0x5f, 0x4a, 0x4f, 0x49, 0x4e, 0x10, 0x05, 0x12, 0x1e, 0x0a, 0x1a, 0x43,
0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x45, 0x43,
0x55, 0x54, 0x45, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x06, 0x42, 0x22, 0x5a, 0x20, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x71, 0x6c, 0x69, 0x74, 0x65,
0x2f, 0x72, 0x71, 0x6c, 0x69, 0x74, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -1492,45 +1436,44 @@ func file_command_proto_rawDescGZIP() []byte {
return file_command_proto_rawDescData return file_command_proto_rawDescData
} }
var file_command_proto_enumTypes = make([]protoimpl.EnumInfo, 4) var file_command_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
var file_command_proto_msgTypes = make([]protoimpl.MessageInfo, 17) var file_command_proto_msgTypes = make([]protoimpl.MessageInfo, 17)
var file_command_proto_goTypes = []interface{}{ var file_command_proto_goTypes = []interface{}{
(QueryRequest_Level)(0), // 0: command.QueryRequest.Level (QueryRequest_Level)(0), // 0: command.QueryRequest.Level
(ExecuteQueryRequest_Level)(0), // 1: command.ExecuteQueryRequest.Level (BackupRequest_Format)(0), // 1: command.BackupRequest.Format
(BackupRequest_Format)(0), // 2: command.BackupRequest.Format (Command_Type)(0), // 2: command.Command.Type
(Command_Type)(0), // 3: command.Command.Type (*Parameter)(nil), // 3: command.Parameter
(*Parameter)(nil), // 4: command.Parameter (*Statement)(nil), // 4: command.Statement
(*Statement)(nil), // 5: command.Statement (*Request)(nil), // 5: command.Request
(*Request)(nil), // 6: command.Request (*QueryRequest)(nil), // 6: command.QueryRequest
(*QueryRequest)(nil), // 7: command.QueryRequest (*Values)(nil), // 7: command.Values
(*Values)(nil), // 8: command.Values (*QueryRows)(nil), // 8: command.QueryRows
(*QueryRows)(nil), // 9: command.QueryRows (*ExecuteRequest)(nil), // 9: command.ExecuteRequest
(*ExecuteRequest)(nil), // 10: command.ExecuteRequest (*ExecuteResult)(nil), // 10: command.ExecuteResult
(*ExecuteResult)(nil), // 11: command.ExecuteResult (*ExecuteQueryRequest)(nil), // 11: command.ExecuteQueryRequest
(*ExecuteQueryRequest)(nil), // 12: command.ExecuteQueryRequest (*ExecuteQueryResponse)(nil), // 12: command.ExecuteQueryResponse
(*ExecuteQueryResponse)(nil), // 13: command.ExecuteQueryResponse (*BackupRequest)(nil), // 13: command.BackupRequest
(*BackupRequest)(nil), // 14: command.BackupRequest (*LoadRequest)(nil), // 14: command.LoadRequest
(*LoadRequest)(nil), // 15: command.LoadRequest (*JoinRequest)(nil), // 15: command.JoinRequest
(*JoinRequest)(nil), // 16: command.JoinRequest (*NotifyRequest)(nil), // 16: command.NotifyRequest
(*NotifyRequest)(nil), // 17: command.NotifyRequest (*RemoveNodeRequest)(nil), // 17: command.RemoveNodeRequest
(*RemoveNodeRequest)(nil), // 18: command.RemoveNodeRequest (*Noop)(nil), // 18: command.Noop
(*Noop)(nil), // 19: command.Noop (*Command)(nil), // 19: command.Command
(*Command)(nil), // 20: command.Command
} }
var file_command_proto_depIdxs = []int32{ var file_command_proto_depIdxs = []int32{
4, // 0: command.Statement.parameters:type_name -> command.Parameter 3, // 0: command.Statement.parameters:type_name -> command.Parameter
5, // 1: command.Request.statements:type_name -> command.Statement 4, // 1: command.Request.statements:type_name -> command.Statement
6, // 2: command.QueryRequest.request:type_name -> command.Request 5, // 2: command.QueryRequest.request:type_name -> command.Request
0, // 3: command.QueryRequest.level:type_name -> command.QueryRequest.Level 0, // 3: command.QueryRequest.level:type_name -> command.QueryRequest.Level
4, // 4: command.Values.parameters:type_name -> command.Parameter 3, // 4: command.Values.parameters:type_name -> command.Parameter
8, // 5: command.QueryRows.values:type_name -> command.Values 7, // 5: command.QueryRows.values:type_name -> command.Values
6, // 6: command.ExecuteRequest.request:type_name -> command.Request 5, // 6: command.ExecuteRequest.request:type_name -> command.Request
6, // 7: command.ExecuteQueryRequest.request:type_name -> command.Request 5, // 7: command.ExecuteQueryRequest.request:type_name -> command.Request
1, // 8: command.ExecuteQueryRequest.level:type_name -> command.ExecuteQueryRequest.Level 0, // 8: command.ExecuteQueryRequest.level:type_name -> command.QueryRequest.Level
9, // 9: command.ExecuteQueryResponse.q:type_name -> command.QueryRows 8, // 9: command.ExecuteQueryResponse.q:type_name -> command.QueryRows
11, // 10: command.ExecuteQueryResponse.e:type_name -> command.ExecuteResult 10, // 10: command.ExecuteQueryResponse.e:type_name -> command.ExecuteResult
2, // 11: command.BackupRequest.format:type_name -> command.BackupRequest.Format 1, // 11: command.BackupRequest.format:type_name -> command.BackupRequest.Format
3, // 12: command.Command.type:type_name -> command.Command.Type 2, // 12: command.Command.type:type_name -> command.Command.Type
13, // [13:13] is the sub-list for method output_type 13, // [13:13] is the sub-list for method output_type
13, // [13:13] is the sub-list for method input_type 13, // [13:13] is the sub-list for method input_type
13, // [13:13] is the sub-list for extension type_name 13, // [13:13] is the sub-list for extension type_name
@ -1766,7 +1709,7 @@ func file_command_proto_init() {
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_command_proto_rawDesc, RawDescriptor: file_command_proto_rawDesc,
NumEnums: 4, NumEnums: 3,
NumMessages: 17, NumMessages: 17,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,

@ -63,12 +63,7 @@ message ExecuteResult {
message ExecuteQueryRequest { message ExecuteQueryRequest {
Request request = 1; Request request = 1;
bool timings = 2; bool timings = 2;
enum Level { QueryRequest.Level level = 3;
QUERY_REQUEST_LEVEL_NONE = 0;
QUERY_REQUEST_LEVEL_WEAK = 1;
QUERY_REQUEST_LEVEL_STRONG = 2;
}
Level level = 3;
int64 freshness = 4; int64 freshness = 4;
} }

@ -212,16 +212,3 @@ func gzUncompress(b []byte) ([]byte, error) {
} }
return ub, nil return ub, nil
} }
func MapConsistencyLevel(in QueryRequest_Level) ExecuteQueryRequest_Level {
switch in {
case QueryRequest_QUERY_REQUEST_LEVEL_NONE:
return ExecuteQueryRequest_QUERY_REQUEST_LEVEL_NONE
case QueryRequest_QUERY_REQUEST_LEVEL_WEAK:
return ExecuteQueryRequest_QUERY_REQUEST_LEVEL_WEAK
case QueryRequest_QUERY_REQUEST_LEVEL_STRONG:
return ExecuteQueryRequest_QUERY_REQUEST_LEVEL_STRONG
default:
return ExecuteQueryRequest_QUERY_REQUEST_LEVEL_WEAK
}
}

@ -2049,12 +2049,12 @@ func queryReqParams(req *http.Request, def time.Duration) (timeout, frsh time.Du
return return
} }
func executeQueryReqParams(req *http.Request, def time.Duration) (timeout, frsh time.Duration, lvl command.ExecuteQueryRequest_Level, isTx, timings, redirect, noRwRandom, isAssoc bool, err error) { func executeQueryReqParams(req *http.Request, def time.Duration) (timeout, frsh time.Duration, lvl command.QueryRequest_Level, isTx, timings, redirect, noRwRandom, isAssoc bool, err error) {
timeout, frsh, qLvl, isTx, timings, redirect, noRwRandom, isAssoc, err := queryReqParams(req, defaultTimeout) timeout, frsh, lvl, isTx, timings, redirect, noRwRandom, isAssoc, err = queryReqParams(req, defaultTimeout)
if err != nil { if err != nil {
return 0, 0, command.ExecuteQueryRequest_QUERY_REQUEST_LEVEL_WEAK, false, false, false, false, false, err return 0, 0, command.QueryRequest_QUERY_REQUEST_LEVEL_WEAK, false, false, false, false, false, err
} }
return timeout, frsh, command.MapConsistencyLevel(qLvl), isTx, timings, redirect, noRwRandom, isAssoc, nil return timeout, frsh, lvl, isTx, timings, redirect, noRwRandom, isAssoc, nil
} }
// noLeader returns whether processing should skip the leader check. // noLeader returns whether processing should skip the leader check.

@ -965,7 +965,7 @@ func (s *Store) Request(eqr *command.ExecuteQueryRequest) ([]*command.ExecuteQue
} }
if !s.RequiresLeader(eqr) { if !s.RequiresLeader(eqr) {
if eqr.Level == command.ExecuteQueryRequest_QUERY_REQUEST_LEVEL_NONE && eqr.Freshness > 0 && if eqr.Level == command.QueryRequest_QUERY_REQUEST_LEVEL_NONE && eqr.Freshness > 0 &&
time.Since(s.raft.LastContact()).Nanoseconds() > eqr.Freshness { time.Since(s.raft.LastContact()).Nanoseconds() > eqr.Freshness {
return nil, ErrStaleRead return nil, ErrStaleRead
} }
@ -1294,7 +1294,7 @@ func (s *Store) Noop(id string) error {
// RequiresLeader returns whether the given ExecuteQueryRequest must be // RequiresLeader returns whether the given ExecuteQueryRequest must be
// processed on the cluster Leader. // processed on the cluster Leader.
func (s *Store) RequiresLeader(eqr *command.ExecuteQueryRequest) bool { func (s *Store) RequiresLeader(eqr *command.ExecuteQueryRequest) bool {
if eqr.Level != command.ExecuteQueryRequest_QUERY_REQUEST_LEVEL_NONE { if eqr.Level != command.QueryRequest_QUERY_REQUEST_LEVEL_NONE {
return true return true
} }

@ -515,7 +515,7 @@ func Test_SingleNodeInMemRequest(t *testing.T) {
} }
for _, tt := range tests { for _, tt := range tests {
eqr := executeQueryRequestFromStrings(tt.stmts, command.ExecuteQueryRequest_QUERY_REQUEST_LEVEL_WEAK, false, false) eqr := executeQueryRequestFromStrings(tt.stmts, command.QueryRequest_QUERY_REQUEST_LEVEL_WEAK, false, false)
r, err := s.Request(eqr) r, err := s.Request(eqr)
if err != nil { if err != nil {
t.Fatalf("failed to execute request on single node: %s", err.Error()) t.Fatalf("failed to execute request on single node: %s", err.Error())
@ -593,7 +593,7 @@ func Test_SingleNodeInMemRequestTx(t *testing.T) {
} }
for _, tt := range tests { for _, tt := range tests {
eqr := executeQueryRequestFromStrings(tt.stmts, command.ExecuteQueryRequest_QUERY_REQUEST_LEVEL_WEAK, false, tt.tx) eqr := executeQueryRequestFromStrings(tt.stmts, command.QueryRequest_QUERY_REQUEST_LEVEL_WEAK, false, tt.tx)
r, err := s.Request(eqr) r, err := s.Request(eqr)
if err != nil { if err != nil {
t.Fatalf("failed to execute request on single node: %s", err.Error()) t.Fatalf("failed to execute request on single node: %s", err.Error())
@ -2307,7 +2307,7 @@ func Test_MultiNodeExecuteQueryFreshness(t *testing.T) {
} }
// Check Stale-read detection works with Requests too. // Check Stale-read detection works with Requests too.
eqr := executeQueryRequestFromString("SELECT * FROM foo", command.ExecuteQueryRequest_QUERY_REQUEST_LEVEL_NONE, eqr := executeQueryRequestFromString("SELECT * FROM foo", command.QueryRequest_QUERY_REQUEST_LEVEL_NONE,
false, false) false, false)
eqr.Freshness = mustParseDuration("1ns").Nanoseconds() eqr.Freshness = mustParseDuration("1ns").Nanoseconds()
_, err = s1.Request(eqr) _, err = s1.Request(eqr)
@ -2692,7 +2692,7 @@ func Test_RequiresLeader(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
stmts []string stmts []string
lvl command.ExecuteQueryRequest_Level lvl command.QueryRequest_Level
requires bool requires bool
}{ }{
{ {
@ -2733,43 +2733,43 @@ func Test_RequiresLeader(t *testing.T) {
{ {
name: "Single SELECT with NONE", name: "Single SELECT with NONE",
stmts: []string{"SELECT * FROM foo"}, stmts: []string{"SELECT * FROM foo"},
lvl: command.ExecuteQueryRequest_QUERY_REQUEST_LEVEL_NONE, lvl: command.QueryRequest_QUERY_REQUEST_LEVEL_NONE,
requires: false, requires: false,
}, },
{ {
name: "Single SELECT from non-existent table with NONE", name: "Single SELECT from non-existent table with NONE",
stmts: []string{"SELECT * FROM qux"}, stmts: []string{"SELECT * FROM qux"},
lvl: command.ExecuteQueryRequest_QUERY_REQUEST_LEVEL_NONE, lvl: command.QueryRequest_QUERY_REQUEST_LEVEL_NONE,
requires: true, requires: true,
}, },
{ {
name: "Double SELECT with NONE", name: "Double SELECT with NONE",
stmts: []string{"SELECT * FROM foo", "SELECT * FROM foo WHERE id = 1"}, stmts: []string{"SELECT * FROM foo", "SELECT * FROM foo WHERE id = 1"},
lvl: command.ExecuteQueryRequest_QUERY_REQUEST_LEVEL_NONE, lvl: command.QueryRequest_QUERY_REQUEST_LEVEL_NONE,
requires: false, requires: false,
}, },
{ {
name: "Single SELECT with STRONG", name: "Single SELECT with STRONG",
stmts: []string{"SELECT * FROM foo"}, stmts: []string{"SELECT * FROM foo"},
lvl: command.ExecuteQueryRequest_QUERY_REQUEST_LEVEL_STRONG, lvl: command.QueryRequest_QUERY_REQUEST_LEVEL_STRONG,
requires: true, requires: true,
}, },
{ {
name: "Single SELECT with WEAK", name: "Single SELECT with WEAK",
stmts: []string{"SELECT * FROM foo"}, stmts: []string{"SELECT * FROM foo"},
lvl: command.ExecuteQueryRequest_QUERY_REQUEST_LEVEL_WEAK, lvl: command.QueryRequest_QUERY_REQUEST_LEVEL_WEAK,
requires: true, requires: true,
}, },
{ {
name: "Mix queries and executes with NONE", name: "Mix queries and executes with NONE",
stmts: []string{"SELECT * FROM foo", "INSERT INTO foo(id, name) VALUES(1, 'fiona')"}, stmts: []string{"SELECT * FROM foo", "INSERT INTO foo(id, name) VALUES(1, 'fiona')"},
lvl: command.ExecuteQueryRequest_QUERY_REQUEST_LEVEL_NONE, lvl: command.QueryRequest_QUERY_REQUEST_LEVEL_NONE,
requires: true, requires: true,
}, },
{ {
name: "Mix queries and executes with WEAK", name: "Mix queries and executes with WEAK",
stmts: []string{"SELECT * FROM foo", "INSERT INTO foo(id, name) VALUES(1, 'fiona')"}, stmts: []string{"SELECT * FROM foo", "INSERT INTO foo(id, name) VALUES(1, 'fiona')"},
lvl: command.ExecuteQueryRequest_QUERY_REQUEST_LEVEL_WEAK, lvl: command.QueryRequest_QUERY_REQUEST_LEVEL_WEAK,
requires: true, requires: true,
}, },
} }
@ -2953,11 +2953,11 @@ func queryRequestFromStrings(s []string, timings, tx bool) *command.QueryRequest
} }
} }
func executeQueryRequestFromString(s string, lvl command.ExecuteQueryRequest_Level, timings, tx bool) *command.ExecuteQueryRequest { func executeQueryRequestFromString(s string, lvl command.QueryRequest_Level, timings, tx bool) *command.ExecuteQueryRequest {
return executeQueryRequestFromStrings([]string{s}, lvl, timings, tx) return executeQueryRequestFromStrings([]string{s}, lvl, timings, tx)
} }
func executeQueryRequestFromStrings(s []string, lvl command.ExecuteQueryRequest_Level, timings, tx bool) *command.ExecuteQueryRequest { func executeQueryRequestFromStrings(s []string, lvl command.QueryRequest_Level, timings, tx bool) *command.ExecuteQueryRequest {
stmts := make([]*command.Statement, len(s)) stmts := make([]*command.Statement, len(s))
for i := range s { for i := range s {
stmts[i] = &command.Statement{ stmts[i] = &command.Statement{

Loading…
Cancel
Save