~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/serialize/table.proto

  • Committer: Monty Taylor
  • Date: 2009-03-24 17:44:41 UTC
  • mto: (960.5.2 mordred)
  • mto: This revision was merged to the branch mainline in revision 964.
  • Revision ID: mordred@inaugust.com-20090324174441-nmsq0gwjlgf7f0mt
Changed handlerton to StorageEngine.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
package drizzle;
 
2
option optimize_for = SPEED;
2
3
 
3
4
message Table {
4
5
 
16
17
        STRING = 2;
17
18
      }
18
19
 
19
 
      required string name = 1;
20
 
      required string value = 2;
21
 
      required EngineOptionType type = 3;
 
20
      required string option_name = 1;
 
21
      required string option_value = 2;
 
22
      required EngineOptionType option_type = 3;
22
23
    }
23
24
 
24
25
    required string name = 1;
27
28
 
28
29
  message TableOptions {
29
30
    optional uint64 auto_increment = 1;
30
 
    optional string charset = 2;
31
 
    optional string collation = 3;
 
31
    optional string collation = 2;
 
32
    optional uint32 collation_id = 3;
 
33
    optional string connect_string = 4;
 
34
    optional string data_file_name = 5;
 
35
    optional string index_file_name = 6;
 
36
    optional uint64 max_rows = 7;
 
37
    optional uint64 min_rows = 8;
 
38
    optional uint64 auto_increment_value = 9;
 
39
    optional uint32 avg_row_length = 11;
 
40
    optional uint32 key_block_size = 12;
 
41
    optional uint32 block_size = 13;
 
42
    optional string comment = 14;
 
43
    optional bool pack_keys = 15;
 
44
    optional bool pack_record = 16;
 
45
    optional bool checksum = 17;
 
46
    optional bool page_checksum = 18;
 
47
    optional bool delay_key_write = 19;
 
48
 
 
49
    enum RowType {
 
50
         ROW_TYPE_DEFAULT = 0;
 
51
         ROW_TYPE_FIXED = 1;
 
52
         ROW_TYPE_DYNAMIC = 2;
 
53
         ROW_TYPE_COMPRESSED = 3;
 
54
         ROW_TYPE_REDUNDANT = 4;
 
55
         ROW_TYPE_COMPACT = 5;
 
56
         ROW_TYPE_PAGE = 6;
 
57
    }
 
58
 
 
59
    optional RowType row_type = 20;
32
60
  }
33
61
 
34
62
  message TableStats {
49
77
    enum FieldType {
50
78
      DOUBLE = 0;
51
79
      VARCHAR = 1;
52
 
      TEXT = 2;
53
 
      BLOB = 3;
54
 
      ENUM = 4;
55
 
      SET = 5;
56
 
      TINYINT = 6;
57
 
      SMALLINT = 7;
58
 
      INTEGER = 8;
59
 
      BIGINT = 9;
60
 
      DECIMAL = 10;
61
 
      VARBINARY = 11;
62
 
      DATE = 12;
63
 
      TIME = 13;
64
 
      TIMESTAMP = 14;
65
 
      DATETIME = 15;
 
80
      BLOB = 2;
 
81
      ENUM = 3;
 
82
      INTEGER = 4;
 
83
      BIGINT = 5;
 
84
      DECIMAL = 6;
 
85
      DATE = 7;
 
86
      TIME = 8;
 
87
      TIMESTAMP = 9;
 
88
      DATETIME = 10;
 
89
      TINYINT = 11;
 
90
      VIRTUAL = 12;
 
91
    }
 
92
 
 
93
    enum FieldFormatType {
 
94
      DefaultFormat= 0;
 
95
      FixedFormat= 1;
 
96
      DynamicFormat= 2;
66
97
    }
67
98
 
68
99
    message FieldOptions {
69
 
      optional string default_value = 2;
 
100
      optional string default_value = 1;
 
101
      optional string update_value = 2;
 
102
      optional bool default_null = 3 [default = false];
 
103
      optional bytes default_bin_value = 4;
 
104
 
 
105
      optional int32 length = 100; /* TODO: should go away */
70
106
    }
71
107
 
72
108
    message TimestampFieldOptions {
89
125
    message StringFieldOptions {
90
126
      optional bool is_fixed_width = 1 [default = false];
91
127
      optional int32 length = 2;
92
 
      optional string charset = 3; /* Perhaps this can go away soon...*/
 
128
      optional uint32 collation_id = 3;
93
129
      optional string collation = 4;
94
130
    }
95
131
 
96
132
    message SetFieldOptions {
97
133
      required int32 count_elements = 1;
98
 
      repeated string value = 2;
 
134
      optional uint32 collation_id = 2;
 
135
      optional string collation = 3;
 
136
      repeated bytes field_value = 4;
 
137
    }
 
138
 
 
139
    message VirtualFieldOptions {
 
140
      required FieldType type = 1;
 
141
      required bool physically_stored = 2;
 
142
      /* optional as we could optimise some cases in future */
 
143
      optional string expression = 3;
99
144
    }
100
145
 
101
146
    required string name = 1;
102
147
    required FieldType type = 2;
103
 
    optional FieldOptions options = 3;
104
 
    optional FieldConstraints constraints = 4;
105
 
    optional NumericFieldOptions numeric_options = 5;
106
 
    optional StringFieldOptions string_options = 6;
 
148
    optional FieldFormatType format = 3;
 
149
    optional FieldOptions options = 4;
 
150
    optional FieldConstraints constraints = 5;
 
151
    optional NumericFieldOptions numeric_options = 6;
 
152
    optional StringFieldOptions string_options = 7;
 
153
    optional VirtualFieldOptions virtual_options = 8;
 
154
 
107
155
    optional string comment = 16; /* Reserve 0-15 for frequently accessed attributes */
108
156
    optional SetFieldOptions set_options = 17;
109
157
    optional TimestampFieldOptions timestamp_options = 18;
 
158
 
 
159
    optional uint32 pack_flag = 100; /* MUST DIE */
110
160
  }
111
161
 
112
162
  message Index {
113
163
 
114
164
    enum IndexType {
115
 
      UNKNOWN = 0;
116
 
      HASH = 1;
117
 
      BTREE = 2;
118
 
      RTREE = 3;
 
165
    /* Kept in sync with enum ha_key_alg if only for stewart's sanity. */
 
166
      UNKNOWN_INDEX = 0;
 
167
      BTREE = 1;
 
168
      RTREE = 2;
 
169
      HASH  = 3;
119
170
      FULLTEXT = 4;
120
171
    }
121
172
 
122
173
    message IndexPart {
123
 
      required Field field = 1;
 
174
      required uint32 fieldnr = 1;
124
175
      optional int32 compare_length = 2;
125
176
      optional bool in_reverse_order = 3 [default = false];
 
177
 
 
178
      optional uint32 key_type = 101; /* THIS MUST DIE. Along with pack_flag*/
126
179
    }
127
180
 
 
181
    message IndexOptions {
 
182
      optional bool pack_key = 1;
 
183
      optional bool binary_pack_key = 2;
 
184
      optional bool var_length_key = 3;
 
185
      optional bool null_part_key = 4;
 
186
      optional uint32 key_block_size = 5;
 
187
      optional bool has_partial_segments =6;
 
188
      optional bool auto_generated_key = 7;
 
189
    }      
 
190
 
128
191
    required string name = 1;
129
192
    required bool is_primary = 2;
130
193
    required bool is_unique = 3;
131
 
    required IndexType type = 4 [default = UNKNOWN];
132
 
    repeated IndexPart index_part = 5;
 
194
    required IndexType type = 4 [default = UNKNOWN_INDEX];
 
195
    required uint32 key_length = 5;
 
196
    repeated IndexPart index_part = 6;
 
197
    optional IndexOptions options= 7;
 
198
    optional string comment = 8;
133
199
  }
134
200
 
135
201
  required string name = 1;
136
202
  required TableType type = 5;
137
203
  required StorageEngine engine = 2;
138
204
  repeated Field field = 3;
139
 
  repeated Index index = 4;
 
205
  repeated Index indexes = 4;
140
206
 
141
207
  repeated ForeignKeyConstraint fk_constraint = 8;
142
208
  optional TableOptions options = 9;
143
209
  optional TableStats stats = 10;
144
 
 
145
 
  optional string comment = 16;
146
210
}
147
211
 
148
212
message TableList {