-
Notifications
You must be signed in to change notification settings - Fork 26
/
common.proto
166 lines (144 loc) · 4.17 KB
/
common.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
// Copyright 2023 Greptime Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package greptime.v1;
option java_package = "io.greptime.v1";
option java_outer_classname = "Common";
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1";
message QueryContext {
string current_catalog = 1;
string current_schema = 2;
string timezone = 4;
map<string, string> extensions = 5;
uint32 channel = 6;
}
message RequestHeader {
// The `catalog` that is selected to be used in this request.
string catalog = 1;
// The `schema` that is selected to be used in this request.
string schema = 2;
// The `authorization` header, much like http's authorization header.
AuthHeader authorization = 3;
// The `dbname` for the request
string dbname = 4;
// Encoded trace_id & span_id, follow the w3c Trace Context
// https://www.w3.org/TR/trace-context/#header-name
map<string, string> tracing_context = 5;
// The `timezone` for the request
string timezone = 6;
}
message ResponseHeader { Status status = 1; }
message Status {
// Corresponding to the `StatusCode` definition of GreptimeDB
uint32 status_code = 1;
string err_msg = 2;
}
message AuthHeader {
oneof auth_scheme {
Basic basic = 1;
Token token = 2;
}
}
message Basic {
string username = 1;
string password = 2;
}
message Token { string token = 1; }
message TableName {
string catalog_name = 1;
string schema_name = 2;
string table_name = 3;
}
message AffectedRows { uint32 value = 1; }
message Metrics { bytes metrics = 1; }
message ExpireAfter { int64 value = 1; }
message FlightMetadata {
AffectedRows affected_rows = 1;
Metrics metrics = 2;
}
enum SemanticType {
TAG = 0;
FIELD = 1;
TIMESTAMP = 2;
}
enum ColumnDataType {
BOOLEAN = 0;
INT8 = 1;
INT16 = 2;
INT32 = 3;
INT64 = 4;
UINT8 = 5;
UINT16 = 6;
UINT32 = 7;
UINT64 = 8;
FLOAT32 = 9;
FLOAT64 = 10;
BINARY = 11;
STRING = 12;
DATE = 13;
DATETIME = 14;
TIMESTAMP_SECOND = 15;
TIMESTAMP_MILLISECOND = 16;
TIMESTAMP_MICROSECOND = 17;
TIMESTAMP_NANOSECOND = 18;
TIME_SECOND = 19;
TIME_MILLISECOND = 20;
TIME_MICROSECOND = 21;
TIME_NANOSECOND = 22;
INTERVAL_YEAR_MONTH = 23;
INTERVAL_DAY_TIME = 24;
INTERVAL_MONTH_DAY_NANO = 25;
DECIMAL128 = 30;
}
message IntervalMonthDayNano {
int32 months = 1;
int32 days = 2;
int64 nanoseconds = 3;
}
// (hi: high 64 bits, lo: low 64 bits) are used to keep the decimal128 value.
message Decimal128 {
int64 hi = 1;
int64 lo = 2;
}
// Type extension for some complex types
message ColumnDataTypeExtension {
oneof type_ext { DecimalTypeExtension decimal_type = 1; }
}
message DecimalTypeExtension {
int32 precision = 1;
int32 scale = 2;
}
// Additional options for the column.
message ColumnOptions {
// Supported keys:
// "fulltext":
// A JSON encoded string containing full-text search options for the column.
//
// The fulltext options JSON structure:
// {
// "enable": bool, // Indicates whether full-text search is
// // enabled for the column.
//
// "analyzer": string, // The language-specific text analyzer to
// // use for indexing and searching text.
// // Supported values: ["English" (Default), "Chinese"].
//
// "case-sensitive": bool // Indicates whether the text should be treated
// // as case-sensitive during full-text search.
// }
//
// Example:
// "fulltext": "{\"enable\": true, \"analyzer\": \"English\", \"case-sensitive\": false}"
map<string, string> options = 1;
}