Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: #143, #174, #175#176

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
soedirgo wants to merge3 commits intomaster
base:master
Choose a base branch
Loading
fromfix/stuff
Draft

fix: #143, #174, #175#176

soedirgo wants to merge3 commits intomasterfromfix/stuff

Conversation

soedirgo
Copy link
Member

@soedirgosoedirgo commentedJan 26, 2022
edited
Loading

#143 and#175 are interrelated (they change the/query response format), so I decided to consolidate the fixes into 1 PR.

Fixes#174

dates,timestamps, andtimestamptzs are no longer converted to JSDates.

date before:"2020-01-01T00:00:00.000Z"

date after:"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 b before:

[]

select 1 as a; select 2 as b after:

[  {"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 x before:

[  {"x":2  }]

select 1 as x, 2 as x after:

[  {"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[][] }[]

@soedirgo
Copy link
MemberAuthor

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.

@soedirgosoedirgo marked this pull request as draftFebruary 18, 2022 09:37
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@phamhieuphamhieuAwaiting requested review from phamhieu

@kiwicopplekiwicoppleAwaiting requested review from kiwicopple

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Columns with the same alias get merged Support results for multi-statement queriesDATEs are returned as JSDates
1 participant
@soedirgo

[8]ページ先頭

©2009-2025 Movatter.jp