-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(qc): don't recurse into children of result nodes
Fixes the broken query plans generated for updates and inserts where the result of the query can satisfied with the query arguments.
- Loading branch information
Showing
3 changed files
with
29 additions
and
1 deletion.
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
13 changes: 13 additions & 0 deletions
13
query-compiler/query-compiler/tests/data/update-one-returning.json
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,13 @@ | ||
{ | ||
"modelName": "User", | ||
"action": "updateOne", | ||
"query": { | ||
"arguments": { | ||
"where": { "email": "[email protected]" }, | ||
"data": { "email": "[email protected]" } | ||
}, | ||
"selection": { | ||
"email": true | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...y-compiler/query-compiler/tests/snapshots/[email protected]
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,10 @@ | ||
--- | ||
source: query-compiler/query-compiler/tests/queries.rs | ||
expression: pretty | ||
input_file: query-compiler/query-compiler/tests/data/update-one-returning.json | ||
--- | ||
unique (query «UPDATE "public"."User" SET "email" = $1 WHERE | ||
("public"."User"."email" = $2 AND 1=1) RETURNING | ||
"public"."User"."id", "public"."User"."email"» | ||
params [const(String("[email protected]")), | ||
const(String("[email protected]"))]) |