-
Notifications
You must be signed in to change notification settings - Fork 326
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: Able to pretty print sql query result in http output #3539
Conversation
Cool! I like the result. Let me take a closer look at the implementation. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3539 +/- ##
==========================================
- Coverage 85.37% 84.99% -0.38%
==========================================
Files 909 910 +1
Lines 151814 151922 +108
==========================================
- Hits 129613 129128 -485
- Misses 22201 22794 +593 |
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.
Nice work, LGTM
|
||
impl TableResponse { | ||
pub async fn from_output(outputs: Vec<crate::error::Result<Output>>) -> HttpResponse { | ||
match handler::from_output(ResponseFormat::Csv, outputs).await { |
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.
typo csv.
But we don't need it at all.
I'm working on a patch to clean up all these unnecessary extra format param.
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
This closes #2877
What's changed and what's your intention?
src/servers/src/http.rs
src/servers/src/http/handler.rs
src/servers/src/http/table_result.rs
Able to pretty print sql query result in http output.
Like this:
Please explain IN DETAIL what the changes are in this PR and why they are needed:
Format the output like Clikehouse's Pretty .
Caculate each column's max width, and then print the result.
It does'not work well in browser.
Checklist