-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(qe): Add comparison for decimal <-> str (#4784)
* Add comparison for decimal <-> str add test for batching unquoted decimals * Moved compact_batch -> q-e-tests/utils assert 5952 is compacted --------- Co-authored-by: Serhii Tatarintsev <tatarintsev@prisma.io>
- Loading branch information
Showing
5 changed files
with
80 additions
and
26 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
query-engine/connector-test-kit-rs/query-engine-tests/src/utils/batch.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,30 @@ | ||
use query_tests_setup::{ | ||
query_core::{BatchDocument, QueryDocument}, | ||
GraphqlBody, MultiQuery, Runner, TestResult, | ||
}; | ||
|
||
use crate::run_query; | ||
|
||
pub async fn compact_batch(runner: &Runner, queries: Vec<String>) -> TestResult<BatchDocument> { | ||
// Ensure individual queries are valid. Helps to debug tests when writing them. | ||
for q in queries.iter() { | ||
run_query!(runner, q.to_string()); | ||
} | ||
|
||
// Ensure batched queries are valid | ||
runner.batch(queries.clone(), false, None).await?.assert_success(); | ||
|
||
let doc = GraphqlBody::Multi(MultiQuery::new( | ||
queries.into_iter().map(Into::into).collect(), | ||
false, | ||
None, | ||
)) | ||
.into_doc() | ||
.unwrap(); | ||
let batch = match doc { | ||
QueryDocument::Multi(batch) => batch.compact(runner.query_schema()), | ||
_ => unreachable!(), | ||
}; | ||
|
||
Ok(batch.compact(runner.query_schema())) | ||
} |
2 changes: 2 additions & 0 deletions
2
query-engine/connector-test-kit-rs/query-engine-tests/src/utils/mod.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
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