2
Message format for tables.
4
package drizzled.message;
5
option optimize_for = SPEED;
7
option java_package = "org.drizzle.messages";
8
option java_outer_classname = "TableMessage";
10
import "engine.proto";
10
message StorageEngine {
12
message EngineOption {
13
enum EngineOptionType {
19
required string name = 1;
20
required string value = 2;
21
required EngineOptionType type = 3;
24
required string name = 1;
25
repeated EngineOption option = 2;
21
28
message TableOptions {
22
optional bool has_user_set_auto_increment_value = 1;
23
optional string collation = 2;
24
optional uint32 collation_id = 3;
25
optional string data_file_name = 5;
26
optional string index_file_name = 6;
27
optional uint64 max_rows = 7;
28
optional uint64 min_rows = 8;
29
optional uint64 auto_increment_value = 9;
30
optional uint32 avg_row_length = 11;
31
optional uint32 block_size = 13;
32
optional string comment = 14;
33
optional bool pack_record = 16;
34
optional bool checksum = 17;
35
optional bool page_checksum = 18;
36
optional bool delay_key_write = 19;
29
optional uint64 auto_increment = 1;
30
optional string charset = 2;
31
optional string collation = 3;
35
optional uint32 avg_row_length = 1;
36
optional uint64 max_rows = 2;
37
optional uint32 min_rows = 3;
39
40
message ForeignKeyConstraint {
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 ];
41
required string name = 1;
42
required Field dependent = 2;
43
required Field parent = 3;
44
/** @TODO Finish this off... */
84
68
message FieldOptions {
85
optional string default_value = 1;
86
optional string update_value = 2;
87
optional bool default_null = 3 [default = false];
88
optional bytes default_bin_value = 4;
89
optional string default_expression = 5;
90
optional string update_expression = 6;
69
optional string default_value = 2;
72
message TimestampFieldOptions {
73
optional bool auto_updates = 1 [default = false];
93
76
message FieldConstraints {
94
optional bool is_nullable = 1 [default = true]; // Dead option, do not use
77
required bool is_nullable = 1 [default = false];
95
78
optional bool is_unsigned = 2 [default = false];
96
optional bool is_notnull = 3 [default = false];
97
optional bool is_unique = 4 [default = false];
98
79
repeated string expression = 16; /* Reserve 0-15 for frequenty accessed attributes */
101
82
message NumericFieldOptions {
102
83
optional bool is_autoincrement = 1 [default = false];
103
optional uint32 scale = 2;
104
optional uint32 precision = 3;
84
optional int32 length = 2;
85
optional int32 scale = 3;
86
optional int32 precision = 4;
107
89
message StringFieldOptions {
108
90
optional bool is_fixed_width = 1 [default = false];
109
optional uint32 length = 2;
110
optional uint32 collation_id = 3;
91
optional int32 length = 2;
92
optional string charset = 3; /* Perhaps this can go away soon...*/
111
93
optional string collation = 4;
114
message EnumerationValues {
115
optional uint32 collation_id = 2;
116
optional string collation = 3;
117
repeated string field_value = 4;
121
Do we store microseconds or timezone.
123
message TimeFieldOptions {
124
optional bool microseconds = 1;
96
message SetFieldOptions {
97
required int32 count_elements = 1;
98
repeated string value = 2;
127
101
required string name = 1;
128
102
required FieldType type = 2;
129
optional FieldOptions options = 4;
130
optional FieldConstraints constraints = 5;
131
optional NumericFieldOptions numeric_options = 6;
132
optional StringFieldOptions string_options = 7;
133
optional TimeFieldOptions time_options = 8;
103
optional FieldOptions options = 3;
104
optional FieldConstraints constraints = 4;
105
optional NumericFieldOptions numeric_options = 5;
106
optional StringFieldOptions string_options = 6;
135
107
optional string comment = 16; /* Reserve 0-15 for frequently accessed attributes */
136
optional EnumerationValues enumeration_values = 17;
108
optional SetFieldOptions set_options = 17;
109
optional TimestampFieldOptions timestamp_options = 18;
142
/* Kept in sync with enum ha_key_alg if only for stewart sanity. */
150
122
message IndexPart {
151
required uint32 fieldnr = 1;
152
optional uint32 compare_length = 2;
123
required Field field = 1;
124
optional int32 compare_length = 2;
153
125
optional bool in_reverse_order = 3 [default = false];
157
optional bool pack_key = 1;
158
optional bool binary_pack_key = 2;
159
optional bool var_length_key = 3;
160
optional bool null_part_key = 4;
161
optional uint32 key_block_size = 5;
162
optional bool has_partial_segments =6;
163
optional bool auto_generated_key = 7;
166
128
required string name = 1;
167
129
required bool is_primary = 2;
168
130
required bool is_unique = 3;
169
required IndexType type = 4 [default = UNKNOWN_INDEX];
170
required uint32 key_length = 5;
171
repeated IndexPart index_part = 6;
172
optional Options options= 7;
173
optional string comment = 8;
131
required IndexType type = 4 [default = UNKNOWN];
132
repeated IndexPart index_part = 5;
176
135
required string name = 1;
177
required string schema = 6;
178
136
required TableType type = 5;
179
required Engine engine = 2;
137
required StorageEngine engine = 2;
180
138
repeated Field field = 3;
181
repeated Index indexes = 4;
139
repeated Index index = 4;
183
141
repeated ForeignKeyConstraint fk_constraint = 8;
184
142
optional TableOptions options = 9;
185
required uint64 creation_timestamp= 11 [default = 0];
186
required uint64 update_timestamp= 12 [default = 0];
187
optional string catalog = 13;
188
optional string uuid = 14;
190
A version value of 0, means that it was never set.
192
optional uint64 version = 15;
143
optional TableStats stats = 10;
145
optional string comment = 16;
196
repeated Table.Field added_field = 1;
149
repeated Table table = 1;