Conversation
Member
Author
|
In hindsight, I wonder if this would require a lot of refactors in Studio. If there are a lot of call sites that rely on the old response format, we can expose the "arrayMode" as a new endpoint instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#143 and #175 are interrelated (they change the
/queryresponse format), so I decided to consolidate the fixes into 1 PR.Fixes #174
dates,timestamps, andtimestamptzs are no longer converted to JSDates.datebefore:"2020-01-01T00:00:00.000Z"dateafter:"2020-01-01"Fixes #143
Queries w/ multiple statements now return results from all statements instead of returning an empty list.
select 1 as a; select 2 as bbefore:select 1 as a; select 2 as bafter:[ { "columns": [ "a" ], "rows": [ [ 1 ] ] }, { "columns": [ "b" ], "rows": [ [ 2 ] ] } ]Fixes #175
Columns with the same alias now works, but this required a breaking change in the response format.
select 1 as x, 2 as xbefore:[ { "x": 2 } ]select 1 as x, 2 as xafter:[ { "columns": [ "x", "x" ], "rows": [ [ 1, 2 ] ] } ]Additional notes
Previously, the response is a list of rows, but now that we support multi-statement queries, the response is a list of query results. In other words:
Type of response before:
Record<string, unknown>[]Type of response after:
{ columns: string[]; rows: unknown[][] }[]