Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] Handle $ signs in values on Mongo (#3211)
* test and first fix idea * rename function
- Loading branch information
Showing
3 changed files
with
57 additions
and
11 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
44 changes: 44 additions & 0 deletions
44
query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/prisma_13089.rs
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,44 @@ | ||
use query_engine_tests::*; | ||
|
||
#[test_suite(schema(schema))] | ||
mod prisma_13097 { | ||
fn schema() -> String { | ||
r#" | ||
model TestModel { | ||
id Int @id @map("_id") | ||
text String | ||
} | ||
"# | ||
.to_owned() | ||
} | ||
|
||
#[connector_test] | ||
async fn filtering_with_dollar_values(runner: Runner) -> TestResult<()> { | ||
insta::assert_snapshot!( | ||
run_query!(&runner, "mutation { createOneTestModel (data: {id: 1, text: \"foo\"}) { id, text }}"), | ||
@r###"{"data":{"createOneTestModel":{"id":1,"text":"foo"}}}"### | ||
); | ||
|
||
insta::assert_snapshot!( | ||
run_query!(&runner, "mutation { createOneTestModel (data: {id: 2, text: \"$foo\"}) { id, text }}"), | ||
@r###"{"data":{"createOneTestModel":{"id":2,"text":"$foo"}}}"### | ||
); | ||
|
||
insta::assert_snapshot!( | ||
run_query!(&runner, "query { findFirstTestModel (where: {text: \"foo\"}) { id, text }}"), | ||
@r###"{"data":{"findFirstTestModel":{"id":1,"text":"foo"}}}"### | ||
); | ||
|
||
insta::assert_snapshot!( | ||
run_query!(&runner, "query { findFirstTestModel (where: {text: \"$foo\"}) { id, text }}"), | ||
@r###"{"data":{"findFirstTestModel":{"id":2,"text":"$foo"}}}"### | ||
); | ||
|
||
insta::assert_snapshot!( | ||
run_query!(&runner, "query { findManyTestModel { id, text }}"), | ||
@r###"{"data":{"findManyTestModel":[{"id":1,"text":"foo"},{"id":2,"text":"$foo"}]}}"### | ||
); | ||
|
||
Ok(()) | ||
} | ||
} |
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