-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gil Mizrahi
committed
Feb 8, 2024
1 parent
8f8aa7f
commit c427a92
Showing
7 changed files
with
194 additions
and
2 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
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
40 changes: 40 additions & 0 deletions
40
.../snapshots/databases_tests__postgres__explain_tests__mutation__delete_playlist_track.snap
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,40 @@ | ||
--- | ||
source: crates/tests/databases-tests/src/postgres/explain_tests.rs | ||
expression: "result.details.get(\"delete_playlist_track SQL Mutation\").unwrap()" | ||
--- | ||
EXPLAIN WITH "%0_NATIVE_QUERY_delete_playlist_track" AS ( | ||
DELETE FROM | ||
public."PlaylistTrack" | ||
WHERE | ||
"TrackId" = 90 RETURNING * | ||
) | ||
SELECT | ||
row_to_json("%2_universe") AS "universe" | ||
FROM | ||
( | ||
SELECT | ||
* | ||
FROM | ||
( | ||
SELECT | ||
json_build_array( | ||
json_build_object( | ||
'__value', | ||
coalesce(json_agg(row_to_json("%3_returning")), '[]') | ||
) | ||
) AS "returning" | ||
FROM | ||
( | ||
SELECT | ||
"%1_delete_playlist_track"."PlaylistId" AS "playlist_id" | ||
FROM | ||
"%0_NATIVE_QUERY_delete_playlist_track" AS "%1_delete_playlist_track" | ||
) AS "%3_returning" | ||
) AS "%3_returning" | ||
CROSS JOIN ( | ||
SELECT | ||
COUNT(*) AS "affected_rows" | ||
FROM | ||
"%0_NATIVE_QUERY_delete_playlist_track" AS "%1_delete_playlist_track" | ||
) AS "%4_aggregates" | ||
) AS "%2_universe" |
106 changes: 106 additions & 0 deletions
106
...es/snapshots/databases_tests__postgres__explain_tests__mutation__insert_artist_album.snap
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,106 @@ | ||
--- | ||
source: crates/tests/databases-tests/src/postgres/explain_tests.rs | ||
expression: queries | ||
--- | ||
EXPLAIN WITH "%0_NATIVE_QUERY_insert_artist" AS ( | ||
INSERT INTO | ||
public."Artist" | ||
VALUES | ||
(276, cast($1 as varchar)) RETURNING * | ||
) | ||
SELECT | ||
row_to_json("%2_universe") AS "universe" | ||
FROM | ||
( | ||
SELECT | ||
* | ||
FROM | ||
( | ||
SELECT | ||
json_build_array( | ||
json_build_object( | ||
'__value', | ||
coalesce(json_agg(row_to_json("%3_returning")), '[]') | ||
) | ||
) AS "returning" | ||
FROM | ||
( | ||
SELECT | ||
"%1_insert_artist"."ArtistId" AS "artist_id", | ||
"%1_insert_artist"."Name" AS "name" | ||
FROM | ||
"%0_NATIVE_QUERY_insert_artist" AS "%1_insert_artist" | ||
) AS "%3_returning" | ||
) AS "%3_returning" | ||
CROSS JOIN ( | ||
SELECT | ||
COUNT(*) AS "affected_rows" | ||
FROM | ||
"%0_NATIVE_QUERY_insert_artist" AS "%1_insert_artist" | ||
) AS "%4_aggregates" | ||
) AS "%2_universe" | ||
|
||
|
||
EXPLAIN WITH "%0_NATIVE_QUERY_insert_album" AS ( | ||
INSERT INTO | ||
public."Album" | ||
VALUES | ||
(348, cast($1 as varchar), 276) RETURNING * | ||
) | ||
SELECT | ||
row_to_json("%6_universe") AS "universe" | ||
FROM | ||
( | ||
SELECT | ||
* | ||
FROM | ||
( | ||
SELECT | ||
json_build_array( | ||
json_build_object( | ||
'__value', | ||
coalesce(json_agg(row_to_json("%7_returning")), '[]') | ||
) | ||
) AS "returning" | ||
FROM | ||
( | ||
SELECT | ||
"%1_insert_album"."AlbumId" AS "album_id", | ||
"%1_insert_album"."Title" AS "title", | ||
"%2_RELATIONSHIP_artist"."artist" AS "artist" | ||
FROM | ||
"%0_NATIVE_QUERY_insert_album" AS "%1_insert_album" | ||
LEFT OUTER JOIN LATERAL ( | ||
SELECT | ||
row_to_json("%2_RELATIONSHIP_artist") AS "artist" | ||
FROM | ||
( | ||
SELECT | ||
* | ||
FROM | ||
( | ||
SELECT | ||
coalesce(json_agg(row_to_json("%4_rows")), '[]') AS "rows" | ||
FROM | ||
( | ||
SELECT | ||
"%3_Artist"."Name" AS "name" | ||
FROM | ||
"public"."Artist" AS "%3_Artist" | ||
WHERE | ||
( | ||
"%1_insert_album"."ArtistId" = "%3_Artist"."ArtistId" | ||
) | ||
) AS "%4_rows" | ||
) AS "%4_rows" | ||
) AS "%2_RELATIONSHIP_artist" | ||
) AS "%2_RELATIONSHIP_artist" ON ('true') | ||
) AS "%7_returning" | ||
) AS "%7_returning" | ||
CROSS JOIN ( | ||
SELECT | ||
COUNT(*) AS "affected_rows" | ||
FROM | ||
"%0_NATIVE_QUERY_insert_album" AS "%1_insert_album" | ||
) AS "%8_aggregates" | ||
) AS "%6_universe" |
File renamed without changes.
File renamed without changes.
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