github.com/matrixorigin/matrixone@v1.2.0/pkg/vm/engine/types.proto (about)

     1  /*
     2   * Copyright 2021 Matrix Origin
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   *      http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  
    17  syntax = "proto3";
    18  package engine;
    19  
    20  import "github.com/gogo/protobuf/gogoproto/gogo.proto";
    21  import "plan.proto";
    22  
    23  option (gogoproto.sizer_all)                = false;
    24  option (gogoproto.protosizer_all)           = true;
    25  option (gogoproto.goproto_enum_prefix_all)  = false;
    26  option (gogoproto.goproto_unrecognized_all) = false;
    27  option (gogoproto.goproto_unkeyed_all)      = false;
    28  option (gogoproto.goproto_sizecache_all)    = false;
    29  
    30  message CommentDef {
    31      option (gogoproto.typedecl) = false;
    32      string Comment              = 1;
    33  }
    34  
    35  message VersionDef {
    36      option (gogoproto.typedecl) = false;
    37      uint32 Version              = 1;
    38  }
    39  
    40  
    41  message PartitionDef {
    42      option (gogoproto.typedecl) = false;
    43      string Partition            = 1;
    44  }
    45  
    46  message ViewDef {
    47      option (gogoproto.typedecl) = false;
    48      string View                 = 1;
    49  }
    50  
    51  message AttributeDef {
    52      option (gogoproto.typedecl) = false;
    53      Attribute Attr              = 1 [(gogoproto.nullable) = false];
    54  }
    55  
    56  message IndexTableDef {
    57      option (gogoproto.typedecl) = false;
    58      int32 Typ                   = 1 [(gogoproto.casttype) = "IndexT"];
    59      repeated string ColNames    = 2;
    60      string Name                 = 3;
    61  }
    62  
    63  message PropertiesDef {
    64      option (gogoproto.typedecl)  = false;
    65      repeated Property Properties = 1 [(gogoproto.nullable) = false];
    66  }
    67  
    68  message ClusterByDef {
    69      option (gogoproto.typedecl) = false;
    70      string Name                 = 1;
    71  }
    72  
    73  message ForeignKeyDef {
    74      option (gogoproto.typedecl)       = false;
    75      repeated plan.ForeignKeyDef Fkeys = 1;
    76  }
    77  
    78  message StreamConfigsDef {
    79      option (gogoproto.typedecl)       = false;
    80      repeated plan.Property Configs = 1;
    81  }
    82  
    83  message PrimaryKeyDef {
    84      option (gogoproto.typedecl) = false;
    85      plan.PrimaryKeyDef Pkey     = 1;
    86  }
    87  
    88  message RefChildTableDef {
    89      option (gogoproto.typedecl) = false;
    90      repeated uint64 Tables      = 1;
    91  }
    92  
    93  message IndexDef {
    94      option (gogoproto.typedecl)    = false;
    95      repeated plan.IndexDef Indexes = 1;
    96  }
    97  
    98  // PB version of ConstraintDef
    99  message ConstraintDefPB {
   100      option (gogoproto.typedecl) = true;
   101      repeated ConstraintPB Cts   = 1 [(gogoproto.nullable) = false];
   102  }
   103  
   104  // PB version of Constraint
   105  message ConstraintPB {
   106      option (gogoproto.typedecl) = true;
   107      oneof ct {
   108          ForeignKeyDef ForeignKeyDef       = 1;
   109          PrimaryKeyDef PrimaryKeyDef       = 2;
   110          RefChildTableDef RefChildTableDef = 3;
   111          IndexDef IndexDef                 = 4;
   112          StreamConfigsDef StreamConfigsDef   = 5;
   113      }
   114  }
   115  
   116  // PB version of TableDef
   117  message TableDefPB {
   118      option (gogoproto.typedecl) = true;
   119      oneof def {
   120          CommentDef CommentDef           = 1;
   121          PartitionDef PartitionDef       = 2;
   122          ViewDef ViewDef                 = 3;
   123          AttributeDef AttributeDef       = 4;
   124          IndexTableDef IndexTableDef     = 5;
   125          PropertiesDef PropertiesDef     = 6;
   126          ClusterByDef ClusterByDef       = 7;
   127          ConstraintDefPB ConstraintDefPB = 8;
   128          VersionDef VersionDef           = 9;
   129      }
   130  }
   131  
   132  message Property {
   133      option (gogoproto.typedecl) = false;
   134      string Key                  = 1;
   135      string Value                = 2;
   136  }
   137  
   138  message Attribute {
   139      option (gogoproto.typedecl) = false;
   140      bool IsHidden               = 1;
   141      bool IsRowId                = 2;
   142      uint64 ID                   = 3;
   143      string Name                 = 4;
   144      uint32 Alg                  = 5 [(gogoproto.casttype) =
   145                          "github.com/matrixorigin/matrixone/pkg/compress.T"];
   146      bytes Type                  = 6 [
   147          (gogoproto.customtype) =
   148              "github.com/matrixorigin/matrixone/pkg/container/types.Type",
   149          (gogoproto.nullable) = false
   150      ];
   151      plan.Default Default   = 7;
   152      plan.OnUpdate OnUpdate = 8;
   153      bool Primary           = 9;
   154      bool ClusterBy         = 10;
   155      string Comment         = 11;
   156      bool AutoIncrement     = 12;
   157  }