Skip to content
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

Able to pretty print sql query result in http output #2877

Closed
MichaelScofield opened this issue Dec 5, 2023 · 2 comments · Fixed by #3539
Closed

Able to pretty print sql query result in http output #2877

MichaelScofield opened this issue Dec 5, 2023 · 2 comments · Fixed by #3539
Labels
good first issue Good for newcomers

Comments

@MichaelScofield
Copy link
Collaborator

MichaelScofield commented Dec 5, 2023

What type of enhancement is this?

API improvement

What does the enhancement do?

Currently the sql query result in http api is printed as json, which is not good for us human to view the table data directly. For example,https://docs.greptime.com/user-guide/protocols/http#post-sql-statements . If we could provide an option to pretty print the sql query result in table format, like mysql clients do, it would be very helpful for maintainer in offline/restricted/limited environment to debug and test our db. So I suggest adding a parameter "format=table" in http api along with "sql=xxx" to this end.

Implementation challenges

No response

@MichaelScofield MichaelScofield added the good first issue Good for newcomers label Dec 5, 2023
@tisonkun
Copy link
Collaborator

tisonkun commented Dec 6, 2023

Related to #577.

We'd better design a format aware API first instead of adding parameter casually.

@tisonkun
Copy link
Collaborator

tisonkun commented Mar 7, 2024

Also ref to ClickHouse's Pretty format - https://clickhouse.com/docs/en/interfaces/formats#pretty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants