-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: crdb enum error on stmt caching
- Loading branch information
Showing
3 changed files
with
65 additions
and
18 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
51 changes: 51 additions & 0 deletions
51
query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/prisma_21901.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,51 @@ | ||
use indoc::indoc; | ||
use query_engine_tests::*; | ||
|
||
#[test_suite(schema(schema))] | ||
mod prisma_21901 { | ||
fn schema() -> String { | ||
let schema = indoc! { | ||
r#"model Test { | ||
#id(id, Int, @id) | ||
colors Color[] | ||
color Color? | ||
} | ||
enum Color { | ||
red | ||
blue | ||
green | ||
} | ||
"# | ||
}; | ||
|
||
schema.to_owned() | ||
} | ||
|
||
// fixes https://github.com/prisma/prisma/issues/21901 | ||
#[connector_test] | ||
async fn test(runner: Runner) -> TestResult<()> { | ||
insta::assert_snapshot!( | ||
run_query!( | ||
runner, | ||
r#"mutation { createOneTest(data: { id: 1, colors: ["red"] }) { colors } }"# | ||
), | ||
@r###"{"data":{"createOneTest":{"colors":["red"]}}}"### | ||
); | ||
|
||
insta::assert_snapshot!( | ||
run_query!(runner, fmt_execute_raw(r#"TRUNCATE TABLE "prisma_21901_test"."Test" CASCADE;"#, [])), | ||
@r###"{"data":{"executeRaw":0}}"### | ||
); | ||
|
||
insta::assert_snapshot!( | ||
run_query!( | ||
runner, | ||
r#"mutation { createOneTest(data: { id: 2, colors: ["blue"] }) { colors } }"# | ||
), | ||
@r###"{"data":{"createOneTest":{"colors":["blue"]}}}"### | ||
); | ||
|
||
Ok(()) | ||
} | ||
} |