2
Message format for tables.
1
4
package drizzled.message;
2
5
option optimize_for = SPEED;
7
option java_package = "org.drizzle.messages";
8
option java_outer_classname = "TableMessage";
10
import "engine.proto";
13
message StorageEngine {
15
message EngineOption {
16
enum EngineOptionType {
22
required string option_name = 1;
23
required string option_value = 2;
24
required EngineOptionType option_type = 3;
27
required string name = 1;
28
repeated EngineOption option = 2;
31
21
message TableOptions {
32
optional uint64 auto_increment = 1;
22
optional bool has_user_set_auto_increment_value = 1;
33
23
optional string collation = 2;
34
24
optional uint32 collation_id = 3;
35
25
optional string data_file_name = 5;
38
28
optional uint64 min_rows = 8;
39
29
optional uint64 auto_increment_value = 9;
40
30
optional uint32 avg_row_length = 11;
41
optional uint32 key_block_size = 12;
42
31
optional uint32 block_size = 13;
43
32
optional string comment = 14;
44
optional bool pack_keys = 15;
45
33
optional bool pack_record = 16;
46
34
optional bool checksum = 17;
47
35
optional bool page_checksum = 18;
48
36
optional bool delay_key_write = 19;
54
ROW_TYPE_COMPRESSED = 3;
55
ROW_TYPE_REDUNDANT = 4;
60
optional RowType row_type = 20;
64
optional uint32 avg_row_length = 1;
65
optional uint64 max_rows = 2;
66
optional uint32 min_rows = 3;
69
39
message ForeignKeyConstraint {
70
required string name = 1;
71
required Field dependent = 2;
72
required Field parent = 3;
73
/** @TODO Finish this off... */
40
optional string name = 1;
41
repeated string column_names = 2;
42
required string references_table_name = 3;
43
repeated string references_columns = 4;
45
enum ForeignKeyMatchOption {
51
required ForeignKeyMatchOption match = 5;
53
enum ForeignKeyOption {
59
OPTION_SET_DEFAULT = 5;
62
required ForeignKeyOption update_option = 6 [ default = OPTION_UNDEF ];
63
required ForeignKeyOption delete_option = 7 [ default = OPTION_UNDEF ];
91
enum FieldFormatType {
97
81
message FieldOptions {
98
82
optional string default_value = 1;
99
83
optional string update_value = 2;
100
84
optional bool default_null = 3 [default = false];
101
85
optional bytes default_bin_value = 4;
104
message TimestampFieldOptions {
105
optional bool auto_updates = 1 [default = false];
86
optional string default_expression = 5;
87
optional string update_expression = 6;
108
90
message FieldConstraints {
133
115
required string name = 1;
134
116
required FieldType type = 2;
135
optional FieldFormatType format = 3;
136
117
optional FieldOptions options = 4;
137
118
optional FieldConstraints constraints = 5;
138
119
optional NumericFieldOptions numeric_options = 6;
141
122
optional string comment = 16; /* Reserve 0-15 for frequently accessed attributes */
142
123
optional EnumerationValues enumeration_values = 17;
143
optional TimestampFieldOptions timestamp_options = 18;
149
/* Kept in sync with enum ha_key_alg if only for stewart's sanity. */
129
/* Kept in sync with enum ha_key_alg if only for stewart sanity. */
150
130
UNKNOWN_INDEX = 0;
158
138
required uint32 fieldnr = 1;
159
139
optional uint32 compare_length = 2;
160
140
optional bool in_reverse_order = 3 [default = false];
162
optional uint32 key_type = 101; /* THIS MUST DIE. Along with pack_flag*/
165
message IndexOptions {
166
144
optional bool pack_key = 1;
167
145
optional bool binary_pack_key = 2;
168
146
optional bool var_length_key = 3;
178
156
required IndexType type = 4 [default = UNKNOWN_INDEX];
179
157
required uint32 key_length = 5;
180
158
repeated IndexPart index_part = 6;
181
optional IndexOptions options= 7;
159
optional Options options= 7;
182
160
optional string comment = 8;
185
163
required string name = 1;
186
164
required string schema = 6;
187
165
required TableType type = 5;
188
required StorageEngine engine = 2;
166
required Engine engine = 2;
189
167
repeated Field field = 3;
190
168
repeated Index indexes = 4;
192
170
repeated ForeignKeyConstraint fk_constraint = 8;
193
171
optional TableOptions options = 9;
194
optional TableStats stats = 10;
195
172
required uint64 creation_timestamp= 11 [default = 0];
196
173
required uint64 update_timestamp= 12 [default = 0];
197
174
optional string catalog = 13;
175
optional string uuid = 14;
177
A version value of 0, means that it was never set.
179
optional uint64 version = 15;
200
182
message AlterTable {