Skip to content

Commit 6c609c9

Browse files
committed
feat: add QueryContext to RegionRequestHeader
1 parent 2c14c6e commit 6c609c9

9 files changed

Lines changed: 11009 additions & 4255 deletions

File tree

c++/greptime/v1/common.pb.cc

Lines changed: 610 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

c++/greptime/v1/common.pb.h

Lines changed: 625 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

c++/greptime/v1/region/server.pb.cc

Lines changed: 774 additions & 138 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

c++/greptime/v1/region/server.pb.h

Lines changed: 772 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/greptime/v1/common.pb.go

Lines changed: 489 additions & 114 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

java/src/main/java/io/greptime/v1/Common.java

Lines changed: 5699 additions & 3832 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

java/src/main/java/io/greptime/v1/region/Server.java

Lines changed: 1994 additions & 104 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/greptime/v1/common.proto

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,40 @@ enum ColumnDataType {
113113
DECIMAL128 = 30;
114114
}
115115

116+
enum SqlDialect {
117+
MYSQL = 0;
118+
POSTGRES = 1;
119+
GREPTIMEDB = 2;
120+
}
121+
122+
enum PostgresByteaOutputValue {
123+
HEX = 0;
124+
ESCAPE = 1;
125+
}
126+
127+
enum PostgresDateTimeStyle {
128+
ISO = 0;
129+
SQL = 1;
130+
Postgres = 2;
131+
German = 3;
132+
}
133+
134+
enum PostgresDateOrder {
135+
MDY = 0;
136+
DMY = 1;
137+
YMD = 2;
138+
}
139+
140+
message PostgresDateStyleFormat {
141+
PostgresDateTimeStyle date_style = 1;
142+
PostgresDateOrder date_order = 2;
143+
}
144+
145+
message ConfigurationVariables {
146+
PostgresByteaOutputValue bytea_output = 1;
147+
PostgresDateStyleFormat datestyle_format = 2;
148+
}
149+
116150
message IntervalMonthDayNano {
117151
int32 months = 1;
118152
int32 days = 2;

proto/greptime/v1/region/server.proto

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,24 @@ import "greptime/v1/ddl.proto";
2626

2727
service Region { rpc Handle(RegionRequest) returns (RegionResponse); }
2828

29+
message QueryContext {
30+
string current_catalog = 1;
31+
string current_schema = 2;
32+
string current_user = 3;
33+
string timezone = 4;
34+
map<string, string> extension = 5;
35+
SqlDialect sql_dialect = 6;
36+
ConfigurationVariables configuration_parameter = 7;
37+
}
38+
2939
message RegionRequestHeader {
3040
// Encoded trace_id & span_id, follow the w3c Trace Context
3141
// https://www.w3.org/TR/trace-context/#header-name
3242
map<string, string> tracing_context = 5;
3343
// DB Name of request, tracking only
3444
string dbname = 3;
35-
// The `timezone` for the request
36-
string timezone = 4;
45+
// The contextual information of the query
46+
QueryContext query_context = 6;
3747
}
3848

3949
message RegionRequest {

0 commit comments

Comments
 (0)