feat: add FlushTableExpr to DdlRequest (#12)

This commit is contained in:
Weny Xu
2023-03-01 15:21:16 +08:00
committed by GitHub
parent 8365873e83
commit ad01872950
2 changed files with 37 additions and 16 deletions
+36 -16
View File
@@ -34,6 +34,7 @@ type DdlRequest struct {
// *DdlRequest_CreateTable
// *DdlRequest_Alter
// *DdlRequest_DropTable
// *DdlRequest_FlushTable
Expr isDdlRequest_Expr `protobuf_oneof:"expr"`
}
@@ -104,6 +105,13 @@ func (x *DdlRequest) GetDropTable() *DropTableExpr {
return nil
}
func (x *DdlRequest) GetFlushTable() *FlushTableExpr {
if x, ok := x.GetExpr().(*DdlRequest_FlushTable); ok {
return x.FlushTable
}
return nil
}
type isDdlRequest_Expr interface {
isDdlRequest_Expr()
}
@@ -124,6 +132,10 @@ type DdlRequest_DropTable struct {
DropTable *DropTableExpr `protobuf:"bytes,4,opt,name=drop_table,json=dropTable,proto3,oneof"`
}
type DdlRequest_FlushTable struct {
FlushTable *FlushTableExpr `protobuf:"bytes,5,opt,name=flush_table,json=flushTable,proto3,oneof"`
}
func (*DdlRequest_CreateDatabase) isDdlRequest_Expr() {}
func (*DdlRequest_CreateTable) isDdlRequest_Expr() {}
@@ -132,6 +144,8 @@ func (*DdlRequest_Alter) isDdlRequest_Expr() {}
func (*DdlRequest_DropTable) isDdlRequest_Expr() {}
func (*DdlRequest_FlushTable) isDdlRequest_Expr() {}
type CreateTableExpr struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -864,7 +878,7 @@ var file_greptime_v1_ddl_proto_rawDesc = []byte{
0x0a, 0x15, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x64,
0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d,
0x65, 0x2e, 0x76, 0x31, 0x1a, 0x18, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x76,
0x31, 0x2f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x90,
0x31, 0x2f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd0,
0x02, 0x0a, 0x0a, 0x44, 0x64, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4a, 0x0a,
0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d,
@@ -881,7 +895,11 @@ var file_greptime_v1_ddl_proto_rawDesc = []byte{
0x64, 0x72, 0x6f, 0x70, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x1a, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44,
0x72, 0x6f, 0x70, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x78, 0x70, 0x72, 0x48, 0x00, 0x52, 0x09,
0x64, 0x72, 0x6f, 0x70, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x65, 0x78, 0x70,
0x64, 0x72, 0x6f, 0x70, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x66, 0x6c, 0x75,
0x73, 0x68, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b,
0x2e, 0x67, 0x72, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6c, 0x75,
0x73, 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x78, 0x70, 0x72, 0x48, 0x00, 0x52, 0x0a, 0x66,
0x6c, 0x75, 0x73, 0x68, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x65, 0x78, 0x70,
0x72, 0x22, 0x9a, 0x04, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c,
0x65, 0x45, 0x78, 0x70, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67,
0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x61, 0x74,
@@ -1023,20 +1041,21 @@ var file_greptime_v1_ddl_proto_depIdxs = []int32{
1, // 1: greptime.v1.DdlRequest.create_table:type_name -> greptime.v1.CreateTableExpr
2, // 2: greptime.v1.DdlRequest.alter:type_name -> greptime.v1.AlterExpr
3, // 3: greptime.v1.DdlRequest.drop_table:type_name -> greptime.v1.DropTableExpr
13, // 4: greptime.v1.CreateTableExpr.column_defs:type_name -> greptime.v1.ColumnDef
12, // 5: greptime.v1.CreateTableExpr.table_options:type_name -> greptime.v1.CreateTableExpr.TableOptionsEntry
11, // 6: greptime.v1.CreateTableExpr.table_id:type_name -> greptime.v1.TableId
6, // 7: greptime.v1.AlterExpr.add_columns:type_name -> greptime.v1.AddColumns
7, // 8: greptime.v1.AlterExpr.drop_columns:type_name -> greptime.v1.DropColumns
8, // 9: greptime.v1.AlterExpr.rename_table:type_name -> greptime.v1.RenameTable
9, // 10: greptime.v1.AddColumns.add_columns:type_name -> greptime.v1.AddColumn
10, // 11: greptime.v1.DropColumns.drop_columns:type_name -> greptime.v1.DropColumn
13, // 12: greptime.v1.AddColumn.column_def:type_name -> greptime.v1.ColumnDef
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 extension type_name
13, // [13:13] is the sub-list for extension extendee
0, // [0:13] is the sub-list for field type_name
4, // 4: greptime.v1.DdlRequest.flush_table:type_name -> greptime.v1.FlushTableExpr
13, // 5: greptime.v1.CreateTableExpr.column_defs:type_name -> greptime.v1.ColumnDef
12, // 6: greptime.v1.CreateTableExpr.table_options:type_name -> greptime.v1.CreateTableExpr.TableOptionsEntry
11, // 7: greptime.v1.CreateTableExpr.table_id:type_name -> greptime.v1.TableId
6, // 8: greptime.v1.AlterExpr.add_columns:type_name -> greptime.v1.AddColumns
7, // 9: greptime.v1.AlterExpr.drop_columns:type_name -> greptime.v1.DropColumns
8, // 10: greptime.v1.AlterExpr.rename_table:type_name -> greptime.v1.RenameTable
9, // 11: greptime.v1.AddColumns.add_columns:type_name -> greptime.v1.AddColumn
10, // 12: greptime.v1.DropColumns.drop_columns:type_name -> greptime.v1.DropColumn
13, // 13: greptime.v1.AddColumn.column_def:type_name -> greptime.v1.ColumnDef
14, // [14:14] is the sub-list for method output_type
14, // [14:14] is the sub-list for method input_type
14, // [14:14] is the sub-list for extension type_name
14, // [14:14] is the sub-list for extension extendee
0, // [0:14] is the sub-list for field type_name
}
func init() { file_greptime_v1_ddl_proto_init() }
@@ -1196,6 +1215,7 @@ func file_greptime_v1_ddl_proto_init() {
(*DdlRequest_CreateTable)(nil),
(*DdlRequest_Alter)(nil),
(*DdlRequest_DropTable)(nil),
(*DdlRequest_FlushTable)(nil),
}
file_greptime_v1_ddl_proto_msgTypes[2].OneofWrappers = []interface{}{
(*AlterExpr_AddColumns)(nil),