~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/table.proto

Merge Joe, plus I updated the tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
package drizzled.message;
5
5
option optimize_for = SPEED;
6
6
 
7
 
option java_package = "org.drizzle.messages";
8
 
option java_outer_classname = "TableMessage";
9
 
 
10
7
import "engine.proto";
11
8
 
12
9
message Table {
19
16
  }
20
17
 
21
18
  message TableOptions {
22
 
    optional bool has_user_set_auto_increment_value = 1;
 
19
    optional uint64 auto_increment = 1;
23
20
    optional string collation = 2;
24
21
    optional uint32 collation_id = 3;
25
22
    optional string data_file_name = 5;
34
31
    optional bool checksum = 17;
35
32
    optional bool page_checksum = 18;
36
33
    optional bool delay_key_write = 19;
 
34
 
 
35
    enum RowType {
 
36
         ROW_TYPE_DEFAULT = 0;
 
37
         ROW_TYPE_FIXED = 1;
 
38
         ROW_TYPE_DYNAMIC = 2;
 
39
         ROW_TYPE_COMPRESSED = 3;
 
40
         ROW_TYPE_REDUNDANT = 4;
 
41
         ROW_TYPE_COMPACT = 5;
 
42
         ROW_TYPE_PAGE = 6;
 
43
    }
 
44
 
 
45
    optional RowType row_type = 20;
37
46
  }
38
47
 
39
48
  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;
44
 
 
45
 
    enum ForeignKeyMatchOption {
46
 
      MATCH_UNDEFINED = 0;
47
 
      MATCH_FULL = 1;
48
 
      MATCH_PARTIAL = 2;
49
 
      MATCH_SIMPLE = 3;
50
 
    }
51
 
    required ForeignKeyMatchOption match = 5;
52
 
 
53
 
    enum ForeignKeyOption {
54
 
      OPTION_UNDEF = 0;
55
 
      OPTION_RESTRICT = 1;
56
 
      OPTION_CASCADE = 2;
57
 
      OPTION_SET_NULL = 3;
58
 
      OPTION_NO_ACTION = 4;
59
 
      OPTION_SET_DEFAULT = 5;
60
 
    }
61
 
 
62
 
    required ForeignKeyOption update_option = 6 [ default = OPTION_UNDEF ];
63
 
    required ForeignKeyOption delete_option = 7 [ default = OPTION_UNDEF ];
 
49
    required string name = 1;
 
50
    required Field dependent = 2;
 
51
    required Field parent = 3;
 
52
    /** @TODO Finish this off... */
64
53
  }
65
54
 
66
55
  message Field {
74
63
      BIGINT = 5;
75
64
      DECIMAL = 6;
76
65
      DATE = 7;
77
 
      EPOCH = 9;
 
66
      TIMESTAMP = 9;
78
67
      DATETIME = 10;
79
 
      UUID = 11;
80
 
      TIME = 12;
81
 
      BOOLEAN = 13;
82
68
    }
83
69
 
84
70
    message FieldOptions {
86
72
      optional string update_value = 2;
87
73
      optional bool default_null = 3 [default = false];
88
74
      optional bytes default_bin_value = 4;
89
 
      optional string default_expression = 5;
90
 
      optional string update_expression = 6;
 
75
    }
 
76
 
 
77
    message TimestampFieldOptions {
 
78
      optional bool auto_updates = 1 [default = false];
91
79
    }
92
80
 
93
81
    message FieldConstraints {
94
 
      optional bool is_nullable = 1 [default = true]; // Dead option, do not use
 
82
      required bool is_nullable = 1 [default = true];
95
83
      optional bool is_unsigned = 2 [default = false];
96
 
      optional bool is_notnull = 3 [default = false];
97
 
      optional bool is_unique = 4 [default = false];
98
84
      repeated string expression = 16; /* Reserve 0-15 for frequenty accessed attributes */
99
85
    }
100
86
 
117
103
      repeated string field_value = 4;
118
104
    }
119
105
 
120
 
    /*
121
 
      Do we store microseconds or timezone.
122
 
    */
123
 
    message TimeFieldOptions {
124
 
      optional bool microseconds = 1;
125
 
    }
126
 
 
127
106
    required string name = 1;
128
107
    required FieldType type = 2;
129
108
    optional FieldOptions options = 4;
130
109
    optional FieldConstraints constraints = 5;
131
110
    optional NumericFieldOptions numeric_options = 6;
132
111
    optional StringFieldOptions string_options = 7;
133
 
    optional TimeFieldOptions time_options = 8;
134
112
 
135
113
    optional string comment = 16; /* Reserve 0-15 for frequently accessed attributes */
136
114
    optional EnumerationValues enumeration_values = 17;
 
115
    optional TimestampFieldOptions timestamp_options = 18;
137
116
  }
138
117
 
139
118
  message Index {
140
119
 
141
120
    enum IndexType {
142
 
    /* Kept in sync with enum ha_key_alg if only for stewart sanity. */
 
121
    /* Kept in sync with enum ha_key_alg if only for stewart's sanity. */
143
122
      UNKNOWN_INDEX = 0;
144
123
      BTREE = 1;
145
124
      RTREE = 2;
185
164
  required uint64 creation_timestamp= 11 [default = 0];
186
165
  required uint64 update_timestamp= 12 [default = 0];
187
166
  optional string catalog = 13;
188
 
  optional string uuid = 14;
189
 
  /*
190
 
    A version value of 0, means that it was never set.
191
 
    */
192
 
  optional uint64 version = 15;
193
167
}
194
168
 
195
169
message AlterTable {