-
Notifications
You must be signed in to change notification settings - Fork 774
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Handle resultsFormat in D1 worker This PR fixes #3160 caused by ignoring the `resultsFormat` query that `workerd` sends. The commits add proper handling of the query. It makes `raw` preserve columns with the same name by handling `resultsFormat=ROWS_AND_COLUMNS` and removes `results` from `run` as it sends `resultsFormat=NONE` (see https://github.com/cloudflare/workerd/blob/1d89f3b8e9cdcd898ea486656d72d9551e79f4a3/src/cloudflare/internal/d1-api.ts#L295) * Handle resultsFormat in D1 worker This PR fixes #3160 caused by ignoring the `resultsFormat` query that `workerd` sends. The commits add proper handling of the query. It makes `raw` preserve columns with the same name by handling `resultsFormat=ROWS_AND_COLUMNS` and removes `results` from `run` as it sends `resultsFormat=NONE` (see https://github.com/cloudflare/workerd/blob/1d89f3b8e9cdcd898ea486656d72d9551e79f4a3/src/cloudflare/internal/d1-api.ts#L295) * Update packages/miniflare/test/plugins/d1/test.ts * Ignore NONE format behaviour in D1 worker See comment: #5917 (comment) * Add passing test for new bindings * Update .changeset/little-jars-train.md * Update .changeset/little-jars-train.md * Update .changeset/little-jars-train.md * Update .changeset/little-jars-train.md * Update little-jars-train.md --------- Co-authored-by: Max Rozen <3822106+rozenmd@users.noreply.github.com>
- Loading branch information
1 parent
81dfb17
commit 64ccdd6
Showing
4 changed files
with
119 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"miniflare": minor | ||
--- | ||
|
||
fix: D1's JOIN behaviour when selecting columns with the same name. | ||
|
||
Properly handle the `resultsFormat` query that `workerd` sends. This partially fixes [the JOIN bug](https://github.com/cloudflare/workers-sdk/issues/3160) and makes the behaviour of `raw` consistent with the `workerd` behaviour. |
This file contains 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
This file contains 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
This file contains 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