-
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.
* feat: support basic deletes * test: update delete tests * refactor: unoption record_filter
- Loading branch information
1 parent
705d9f6
commit 13fef94
Showing
15 changed files
with
192 additions
and
52 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
12 changes: 12 additions & 0 deletions
12
query-compiler/query-compiler/tests/data/delete-many-limit.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,12 @@ | ||
{ | ||
"modelName": "Post", | ||
"action": "deleteMany", | ||
"query": { | ||
"arguments": { | ||
"where": { "title": "whatever" } | ||
}, | ||
"selection": { | ||
"$scalars": true | ||
} | ||
} | ||
} |
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": "Post", | ||
"action": "deleteMany", | ||
"query": { | ||
"arguments": { | ||
"where": { "title": "whatever" }, | ||
"limit": 2 | ||
}, | ||
"selection": { | ||
"$scalars": true | ||
} | ||
} | ||
} |
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,12 @@ | ||
{ | ||
"modelName": "Post", | ||
"action": "deleteOne", | ||
"query": { | ||
"arguments": { | ||
"where": { "id": 1 } | ||
}, | ||
"selection": { | ||
"$scalars": true | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
query-compiler/query-compiler/tests/snapshots/queries__queries@delete-many-limit.json.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,7 @@ | ||
--- | ||
source: query-compiler/query-compiler/tests/queries.rs | ||
expression: pretty | ||
input_file: query-compiler/query-compiler/tests/data/delete-many-limit.json | ||
--- | ||
sum (execute «DELETE FROM "public"."Post" WHERE "public"."Post"."title" = $1» | ||
params [const(String("whatever"))]) |
9 changes: 9 additions & 0 deletions
9
query-compiler/query-compiler/tests/snapshots/queries__queries@delete-many.json.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,9 @@ | ||
--- | ||
source: query-compiler/query-compiler/tests/queries.rs | ||
expression: pretty | ||
input_file: query-compiler/query-compiler/tests/data/delete-many.json | ||
--- | ||
sum (execute «DELETE FROM "public"."Post" WHERE ("public"."Post"."id") IN | ||
(SELECT "public"."Post"."id" FROM "public"."Post" WHERE | ||
"public"."Post"."title" = $1 LIMIT $2)» | ||
params [const(String("whatever")), const(BigInt(2))]) |
9 changes: 9 additions & 0 deletions
9
query-compiler/query-compiler/tests/snapshots/queries__queries@delete-one.json.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,9 @@ | ||
--- | ||
source: query-compiler/query-compiler/tests/queries.rs | ||
expression: pretty | ||
input_file: query-compiler/query-compiler/tests/data/delete-one.json | ||
--- | ||
unique (query «DELETE FROM "public"."Post" WHERE ("public"."Post"."id" = $1 AND | ||
1=1) RETURNING "public"."Post"."id", "public"."Post"."title", | ||
"public"."Post"."userId"» | ||
params [const(BigInt(1))]) |
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
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
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