New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support HTTP&gRPC&pg set timezone #3125
feat: support HTTP&gRPC&pg set timezone #3125
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #3125 +/- ##
==========================================
- Coverage 85.52% 84.93% -0.59%
==========================================
Files 818 825 +7
Lines 133850 135081 +1231
==========================================
+ Hits 114474 114730 +256
- Misses 19376 20351 +975 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about the change from "".to_string()
to String::default()
. Is clippy complaining about it?
In my practice, fn s(s: Option<String>) -> String {
s.unwrap_or("".to_string())
} clippy won't complain about it, but |
I hereby agree to the terms of the GreptimeDB CLA
What's changed and what's your intention?
Support set/get timezone in HTTP&gRPC&pg&mysql
Use unify SQL layer to dispose SQL
SET time_zone = xxx
andshow variables xxxx
, make all protocol support set/get timezoneHTTP
Add a Header named
x-greptime-timezone
, user can carry timezone by this http headergRPC
Add timezone in
GreptimeRequest::RequestHeader
make gRPC query aware timezone infoRelated pr GreptimeTeam/greptime-proto#132
PG
Use
SHOW VARIABLES system_timezone;
andSHOW VARIABLES timezone;
to query system timezone and timezoneUse
Set time_zone = xxx
to set user timezone, system time indicate bytimezone
in frontend config fileMYSQL
Because MYSQL federated intercept SQL parse like
SHOW VARIABLES xxx
.In mysql, we still use
Select @@system_timezone;
andSelect @@timezone;
to query system timezone and timezoneUse
Set time_zone = xxx
to set user timezone, same with PGDocuments will be updated after #2907 finish
Checklist
Refer to a related PR or issue link (optional)
#2907