Skip to content

Commit

Permalink
Unmove the files
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljharvey committed Oct 25, 2024
1 parent bb96d3f commit bf6f502
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"operations": [
{
"type": "procedure",
"name": "insert_Artist",
"name": "v2_insert_Artist",
"arguments": {
"objects": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"operations": [
{
"type": "procedure",
"name": "insert_Dog",
"name": "v2_insert_Dog",
"arguments": {
"objects": [{}, {}, {}, {}],
"post_check": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
source: crates/query-engine/translation/tests/tests.rs
expression: result
---
BEGIN
ISOLATION LEVEL READ COMMITTED READ WRITE;

WITH "%0_generated_mutation" AS (
INSERT INTO
"public"."Artist"("ArtistId", "Name")
VALUES
(276, cast($1 as "pg_catalog"."varchar")),
(DEFAULT, cast($2 as "pg_catalog"."varchar")) RETURNING *,
false AS "%check__constraint"
)
SELECT
(
SELECT
json_build_object('result', row_to_json("%4_universe"), 'type', $3) AS "universe"
FROM
(
SELECT
*
FROM
(
SELECT
coalesce(json_agg(row_to_json("%5_returning")), '[]') AS "returning"
FROM
(
SELECT
"%1_Artist"."ArtistId" AS "artist_id",
"%1_Artist"."Name" AS "name"
FROM
"%0_generated_mutation" AS "%1_Artist"
) AS "%5_returning"
) AS "%5_returning"
CROSS JOIN (
SELECT
COUNT(*) AS "affected_rows"
FROM
(
SELECT
"%2_Artist".*
FROM
"%0_generated_mutation" AS "%2_Artist"
) AS "%3_Artist"
) AS "%6_aggregates"
) AS "%4_universe"
) AS "%results",
(
SELECT
coalesce(
bool_and("%7_v2_insert_Artist"."%check__constraint"),
true
) AS "%check__constraint"
FROM
"%0_generated_mutation" AS "%7_v2_insert_Artist"
) AS "%check__constraint";

COMMIT;

[[(1, String("Olympians")), (2, String("The Other Band")), (3, String("procedure"))]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
source: crates/query-engine/translation/tests/tests.rs
expression: result
---
BEGIN
ISOLATION LEVEL READ COMMITTED READ WRITE;

WITH "%0_generated_mutation" AS (
INSERT INTO
"public"."Dog"
SELECT
FROM
generate_series(1, 4) RETURNING *,
true AS "%check__constraint"
)
SELECT
(
SELECT
json_build_object('result', row_to_json("%4_universe"), 'type', $1) AS "universe"
FROM
(
SELECT
*
FROM
(
SELECT
coalesce(json_agg(row_to_json("%5_returning")), '[]') AS "returning"
FROM
(
SELECT
"%1_Dog"."id" AS "id",
"%1_Dog"."adopter_name" AS "adopter_name"
FROM
"%0_generated_mutation" AS "%1_Dog"
) AS "%5_returning"
) AS "%5_returning"
CROSS JOIN (
SELECT
COUNT(*) AS "affected_rows"
FROM
(
SELECT
"%2_Dog".*
FROM
"%0_generated_mutation" AS "%2_Dog"
) AS "%3_Dog"
) AS "%6_aggregates"
) AS "%4_universe"
) AS "%results",
(
SELECT
coalesce(
bool_and("%7_v2_insert_Dog"."%check__constraint"),
true
) AS "%check__constraint"
FROM
"%0_generated_mutation" AS "%7_v2_insert_Dog"
) AS "%check__constraint";

COMMIT;

[[(1, String("procedure"))]]

0 comments on commit bf6f502

Please sign in to comment.