From a84fe4386fdf0f05bd737b62e5d112ab079c7098 Mon Sep 17 00:00:00 2001 From: Flavian Desverne Date: Fri, 1 Dec 2023 18:28:59 +0100 Subject: [PATCH] rename preview feature from joins to relationJoins --- psl/psl-core/src/common/preview_features.rs | 4 ++-- psl/psl/tests/config/generators.rs | 2 +- .../tests/queries/batch/in_selection_batching.rs | 6 +++--- query-engine/core/src/query_graph_builder/read/utils.rs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/psl/psl-core/src/common/preview_features.rs b/psl/psl-core/src/common/preview_features.rs index 6eeac70c1389..318010ebdf9f 100644 --- a/psl/psl-core/src/common/preview_features.rs +++ b/psl/psl-core/src/common/preview_features.rs @@ -76,7 +76,7 @@ features!( TransactionApi, UncheckedScalarInputs, Views, - Joins + RelationJoins ); /// Generator preview features @@ -91,7 +91,7 @@ pub const ALL_PREVIEW_FEATURES: FeatureMap = FeatureMap { | PostgresqlExtensions | Tracing | Views - | Joins + | RelationJoins }), deprecated: enumflags2::make_bitflags!(PreviewFeature::{ AtomicNumberOperations diff --git a/psl/psl/tests/config/generators.rs b/psl/psl/tests/config/generators.rs index 1152ef910c5a..71130fe0ebd1 100644 --- a/psl/psl/tests/config/generators.rs +++ b/psl/psl/tests/config/generators.rs @@ -258,7 +258,7 @@ fn nice_error_for_unknown_generator_preview_feature() { .unwrap_err(); let expectation = expect![[r#" - error: The preview feature "foo" is not known. Expected one of: deno, driverAdapters, fullTextIndex, fullTextSearch, metrics, multiSchema, postgresqlExtensions, tracing, views, joins + error: The preview feature "foo" is not known. Expected one of: deno, driverAdapters, fullTextIndex, fullTextSearch, metrics, multiSchema, postgresqlExtensions, tracing, views, relationJoins[0m --> schema.prisma:3  |   2 |  provider = "prisma-client-js" diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/batch/in_selection_batching.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/batch/in_selection_batching.rs index 1126201865a4..f5e7face6768 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/batch/in_selection_batching.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/batch/in_selection_batching.rs @@ -37,7 +37,7 @@ mod isb { // "batching of IN queries" should "work when having more than the specified amount of items" // TODO(joins): Excluded because we have no support for batched queries with joins. In practice, it should happen under much less circumstances // TODO(joins): than with the query-based strategy, because we don't issue `WHERE IN (parent_ids)` queries anymore to resolve relations. - #[connector_test(exclude_features("joins"))] + #[connector_test(exclude_features("relationJoins"))] async fn in_more_items(runner: Runner) -> TestResult<()> { create_test_data(&runner).await?; @@ -55,7 +55,7 @@ mod isb { // "ascending ordering of batched IN queries" should "work when having more than the specified amount of items" // TODO(joins): Excluded because we have no support for batched queries with joins. In practice, it should happen under much less circumstances // TODO(joins): than with the query-based strategy, because we don't issue `WHERE IN (parent_ids)` queries anymore to resolve relations. - #[connector_test(exclude_features("joins"))] + #[connector_test(exclude_features("relationJoins"))] async fn asc_in_ordering(runner: Runner) -> TestResult<()> { create_test_data(&runner).await?; @@ -73,7 +73,7 @@ mod isb { // "ascending ordering of batched IN queries" should "work when having more than the specified amount of items" // TODO(joins): Excluded because we have no support for batched queries with joins. In practice, it should happen under much less circumstances // TODO(joins): than with the query-based strategy, because we don't issue `WHERE IN (parent_ids)` queries anymore to resolve relations. - #[connector_test(exclude_features("joins"))] + #[connector_test(exclude_features("relationJoins"))] async fn desc_in_ordering(runner: Runner) -> TestResult<()> { create_test_data(&runner).await?; diff --git a/query-engine/core/src/query_graph_builder/read/utils.rs b/query-engine/core/src/query_graph_builder/read/utils.rs index 95a63db7f8e2..8e5f513ddf95 100644 --- a/query-engine/core/src/query_graph_builder/read/utils.rs +++ b/query-engine/core/src/query_graph_builder/read/utils.rs @@ -74,7 +74,7 @@ where T: Into, { let should_collect_relation_selection = query_schema.has_capability(ConnectorCapability::LateralJoin) - && query_schema.has_feature(PreviewFeature::Joins); + && query_schema.has_feature(PreviewFeature::RelationJoins); let parent = parent.into(); @@ -248,7 +248,7 @@ pub(crate) fn get_relation_load_strategy( aggregation_selections: &[RelAggregationSelection], query_schema: &QuerySchema, ) -> RelationLoadStrategy { - if query_schema.has_feature(PreviewFeature::Joins) + if query_schema.has_feature(PreviewFeature::RelationJoins) && query_schema.has_capability(ConnectorCapability::LateralJoin) && args.cursor.is_none() && args.distinct.is_none()