-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Improve the REST API response format #3526
Comments
Related: #1343 |
I think this would be something we'd want to have as an option (like other REST APIs offer |
Can't say I'm a fan personally. I originally had a more JSON like structure to defining the columns. However, we're an SQL engine and hence I think returning an SQL schema is more correct. Embedding the column names in each returned row is just noise and payload bloat IMHO. |
@big-andy-coates I definitely agree this wouldn't be wanted all the time, and hence a flag in returning it would be useful. |
I refer the right honourable gentleman to my last comment:
Like we don't already have enough to do? ;) :p In all honesty, an issue such as this is unlikely to get any engineering time unless there is a lot of pressure/interest from users. On the face of it, it's a pretty low ROI task. Of course, that's just my honest opinion. |
See https://stackoverflow.com/questions/62131541/parsing-json-returned-with-schema-element-in-java for an example where the current API causes problems for end users. |
/cc @MichaelDrogalis @derekjn any thoughts on this? |
CLI v5.4.0-beta190925193823, Server v5.4.0-beta190925193823
A REST call for a
SELECT
currently returns a body like this:It would be useful if there were an option to return it in a more malleable format, in which the schema and rows were both more accessible.
At the moment it would be necessary to manually parse the
schema
valueand from that associate the numbered entries of the
rows
array with the given field nameSuggestion - Schema
Instead of a single string lump, make each field its own object:
Suggestion - Values
Include the field name in the object so that it can be more easily accessed programatically:
The text was updated successfully, but these errors were encountered: