~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/resultset.proto

  • Committer: Andrew Hutchings
  • Date: 2010-09-08 19:03:09 UTC
  • mfrom: (1750 staging)
  • mto: (1750.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1751.
  • Revision ID: andrew@linuxjedi.co.uk-20100908190309-mya1nu7xvo1fpvk8
Merge trunk into branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package drizzled.message;
 
2
option optimize_for = SPEED;
 
3
 
 
4
import "table.proto";
 
5
import "schema.proto";
 
6
 
 
7
 
 
8
/*
 
9
 * Some minimal information transferred in the header of Statement
 
10
 * submessage classes which identifies metadata about a specific
 
11
 * field involved in a Statemet.
 
12
 */
 
13
message FieldMeta
 
14
{
 
15
  required string field_name = 1; /* Name of the field */
 
16
  optional string field_alias = 2;
 
17
  required string table_name = 3;
 
18
  optional string table_alias = 4;
 
19
  required string schema_name = 5;
 
20
}
 
21
 
 
22
/*
 
23
 * Minimal information transferred in the header of Statement submessage
 
24
 * classes which identifies metadata about the schema objects being
 
25
 * modified in a Statement.
 
26
 */
 
27
message TableMeta
 
28
{
 
29
  required string schema_name = 1; /* Name of the containing schema */
 
30
  required string table_name = 2; /* Name of the table */
 
31
  optional string table_alias = 3; /* alias if defined */
 
32
}
 
33
 
 
34
 
 
35
/*
 
36
 * Represents a single record being returned
 
37
 *
 
38
 * @note 
 
39
 *
 
40
 * A ResultSet contains one or more SelectRecord submessages, each
 
41
 * of which represents a single record returned
 
42
 */
 
43
message SelectRecord
 
44
{
 
45
  repeated bytes record_value = 1;
 
46
  repeated bool is_null = 2;
 
47
}
 
48
 
 
49
message SelectHeader
 
50
{
 
51
  repeated TableMeta table_meta = 1; /* Minimal metadata about the table affected */
 
52
  repeated FieldMeta field_meta = 2; /* Collection of metadata about fields affected */
 
53
}
 
54
 
 
55
message SelectData
 
56
{
 
57
  required uint32 segment_id = 1; /* The segment number */
 
58
  required bool end_segment = 2; /* Is this the final segment? */
 
59
  repeated SelectRecord record = 3; /* The records inserted */
 
60
}
 
61
/*
 
62
 * The message is composed the hash of the query, 
 
63
 * a header (SelectHeader) containing metadata about:
 
64
 * returned tables and fields.
 
65
 * One or more data * segments (SelectData) containing the actual records
 
66
 * being returned.
 
67
 */
 
68
message Resultset
 
69
{
 
70
  required string key= 1; /* contains a hashed value of: query + schema*/
 
71
  required string schema= 2; /*current schema */
 
72
  optional string sql = 3; /* May contain the original SQL string */
 
73
  optional SelectHeader select_header = 4;
 
74
  optional SelectData select_data = 5;
 
75
}