From c9ff5773c72b821ff6daf2c55dbe3809eae7c2c7 Mon Sep 17 00:00:00 2001 From: Serhii Tatarintsev Date: Thu, 12 Sep 2024 16:51:02 +0200 Subject: [PATCH 1/6] qe: Add "strictUndefinedChecks" preview feature (#4997) * qe: Add "strictUndefinedChecks" preview feature * Update snapshots --- psl/psl-core/src/common/preview_features.rs | 4 +++- psl/psl/tests/config/generators.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/psl/psl-core/src/common/preview_features.rs b/psl/psl-core/src/common/preview_features.rs index 49e860575512..ea9b0eceea81 100644 --- a/psl/psl-core/src/common/preview_features.rs +++ b/psl/psl-core/src/common/preview_features.rs @@ -81,7 +81,8 @@ features!( ReactNative, PrismaSchemaFolder, OmitApi, - TypedSql + TypedSql, + StrictUndefinedChecks ); /// Generator preview features (alphabetically sorted) @@ -100,6 +101,7 @@ pub const ALL_PREVIEW_FEATURES: FeatureMap = FeatureMap { | RelationJoins | OmitApi | PrismaSchemaFolder + | StrictUndefinedChecks }), deprecated: enumflags2::make_bitflags!(PreviewFeature::{ AtomicNumberOperations diff --git a/psl/psl/tests/config/generators.rs b/psl/psl/tests/config/generators.rs index 273de14c7443..20e8f8864402 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, nativeDistinct, postgresqlExtensions, tracing, views, relationJoins, prismaSchemaFolder, omitApi + error: The preview feature "foo" is not known. Expected one of: deno, driverAdapters, fullTextIndex, fullTextSearch, metrics, multiSchema, nativeDistinct, postgresqlExtensions, tracing, views, relationJoins, prismaSchemaFolder, omitApi, strictUndefinedChecks --> schema.prisma:3  |   2 |  provider = "prisma-client-js" From c57dd2b64d48873f3e918ce4c8b96430954c027d Mon Sep 17 00:00:00 2001 From: Alberto Schiabel Date: Mon, 23 Sep 2024 18:02:13 +0200 Subject: [PATCH 2/6] fix(ci): fix SQL Server 2017 (#5003) * fix(ci): add fix for SQL Server 2017 * fix(ci): fix schema-engine for SQL Server 2017 * fix(ci): forward ubuntu version to test-query-engine-template * chore: trigger Rust tests * chore(core-tests): undo changes to build.rs * chore: trigger Rust tests --- .github/workflows/test-query-engine-template.yml | 5 ++++- .github/workflows/test-query-engine.yml | 2 ++ .github/workflows/test-schema-engine.yml | 3 ++- schema-engine/cli/tests/cli_tests.rs | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-query-engine-template.yml b/.github/workflows/test-query-engine-template.yml index 5a9c3d692d7c..597953bf771d 100644 --- a/.github/workflows/test-query-engine-template.yml +++ b/.github/workflows/test-query-engine-template.yml @@ -12,6 +12,9 @@ on: version: type: string required: true + ubuntu: + type: string + default: 'latest' single_threaded: type: boolean default: false @@ -46,7 +49,7 @@ jobs: PRISMA_ENGINE_PROTOCOL: ${{ matrix.engine_protocol }} PRISMA_RELATION_LOAD_STRATEGY: ${{ matrix.relation_load_strategy }} - runs-on: ubuntu-latest + runs-on: "ubuntu-${{ inputs.ubuntu }}" steps: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 diff --git a/.github/workflows/test-query-engine.yml b/.github/workflows/test-query-engine.yml index 60a4ab750b64..6ee6629fee80 100644 --- a/.github/workflows/test-query-engine.yml +++ b/.github/workflows/test-query-engine.yml @@ -126,11 +126,13 @@ jobs: version: "2019" - name: "mssql_2017" version: "2017" + ubuntu: "20.04" uses: ./.github/workflows/test-query-engine-template.yml name: mssql ${{ matrix.database.version }} with: name: ${{ matrix.database.name }} version: ${{ matrix.database.version }} + ubuntu: ${{ matrix.database.ubuntu }} connector: "sqlserver" relation_load_strategy: '["query"]' diff --git a/.github/workflows/test-schema-engine.yml b/.github/workflows/test-schema-engine.yml index a661fd0554c8..7d9f76b69a8b 100644 --- a/.github/workflows/test-schema-engine.yml +++ b/.github/workflows/test-schema-engine.yml @@ -62,6 +62,7 @@ jobs: database: - name: mssql_2017 url: "sqlserver://localhost:1434;database=master;user=SA;password=;trustServerCertificate=true;socket_timeout=60;isolationLevel=READ UNCOMMITTED" + ubuntu: "20.04" - name: mssql_2019 url: "sqlserver://localhost:1433;database=master;user=SA;password=;trustServerCertificate=true;socket_timeout=60;isolationLevel=READ UNCOMMITTED" - name: mssql_2022 @@ -104,7 +105,7 @@ jobs: is_vitess: true single_threaded: true - runs-on: ubuntu-latest + runs-on: "ubuntu-${{ matrix.database.ubuntu || 'latest' }}" steps: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 diff --git a/schema-engine/cli/tests/cli_tests.rs b/schema-engine/cli/tests/cli_tests.rs index 973345ac4033..fd89b9bce745 100644 --- a/schema-engine/cli/tests/cli_tests.rs +++ b/schema-engine/cli/tests/cli_tests.rs @@ -51,7 +51,7 @@ where .or_else(|| panic_payload.downcast_ref::().map(|s| s.to_owned())) .unwrap_or_default(); - panic!("Error: '{}'", res) + panic!("Error: '{}'", res); } } } From 06fc58a368dc7be9fbbbe894adf8d445d208c284 Mon Sep 17 00:00:00 2001 From: Alberto Schiabel Date: Mon, 23 Sep 2024 19:48:17 +0200 Subject: [PATCH 3/6] fix(quaint): extract constraint name from CockroachDB foreign key constraint violation error (#5002) * fix(quaint): extract constraint name from cockroachdb foreign key constraint violation error * chore: normalise "regex" version across multiple crates * chore: adjust test assertions for "ForeignKeyViolation" * chore: adjust test assertions for "ForeignKeyViolation" * test(quaint): add explicit regression test for issue prisma/prisma#24072, via new macro "assert_connector_error" * fix(ci): add fix for SQL Server 2017 * fix(ci): fix schema-engine for SQL Server 2017 * chore: get rid of leftover comments * test(quaint): fix tests for MySQL 5.6, 5.7, and MongoDB * chore: get rid of CI: True * Revert "fix(ci): fix schema-engine for SQL Server 2017" This reverts commit 5aebbbfa9af7e19945a8942e272305047f881a9f. * Revert "fix(ci): add fix for SQL Server 2017" This reverts commit f7cdacd90b7ef19d9e842024de48b3139b42f82b. * test(quaint): fix for PlanetScale * test(quaint): fix tests for PlanetScale --- Cargo.lock | 7 +-- Cargo.toml | 1 + libs/prisma-value/Cargo.toml | 2 +- .../src/query_engine/mod.rs | 5 +- psl/psl-core/Cargo.toml | 2 +- quaint/Cargo.toml | 1 + quaint/src/connector/postgres/error.rs | 15 +++--- query-engine/black-box-tests/Cargo.toml | 2 +- .../query-engine-tests/src/utils/querying.rs | 22 ++++++++ .../new/ref_actions/on_delete/set_default.rs | 8 +-- .../new/ref_actions/on_update/set_default.rs | 8 +-- .../tests/new/regressions/mod.rs | 1 + .../tests/new/regressions/prisma_24072.rs | 54 +++++++++++++++++++ .../query-tests-setup/Cargo.toml | 2 +- .../mongodb-query-connector/Cargo.toml | 2 +- .../mongodb-schema-connector/Cargo.toml | 2 +- .../sql-schema-connector/Cargo.toml | 2 +- schema-engine/datamodel-renderer/Cargo.toml | 2 +- schema-engine/sql-schema-describer/Cargo.toml | 2 +- 19 files changed, 110 insertions(+), 30 deletions(-) create mode 100644 query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/prisma_24072.rs diff --git a/Cargo.lock b/Cargo.lock index 14a95793bddb..62a21959bf0f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3801,6 +3801,7 @@ dependencies = [ "postgres-types", "quaint-test-macros", "quaint-test-setup", + "regex", "rusqlite", "serde", "serde_json", @@ -4390,9 +4391,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick 1.0.3", "memchr", @@ -6123,7 +6124,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", - "rand 0.3.23", + "rand 0.8.5", "static_assertions", ] diff --git a/Cargo.toml b/Cargo.toml index 97c5162a3aa3..f2000ba619d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,6 +65,7 @@ napi = { version = "2.15.1", default-features = false, features = [ napi-derive = "2.15.0" js-sys = { version = "0.3" } rand = { version = "0.8" } +regex = { version = "1", features = ["std"] } serde_repr = { version = "0.1.17" } serde-wasm-bindgen = { version = "0.5" } tracing = { version = "0.1" } diff --git a/libs/prisma-value/Cargo.toml b/libs/prisma-value/Cargo.toml index 1a0d28e06db3..9833b6ee104b 100644 --- a/libs/prisma-value/Cargo.toml +++ b/libs/prisma-value/Cargo.toml @@ -7,7 +7,7 @@ version = "0.1.0" base64 = "0.13" chrono.workspace = true once_cell = "1.3" -regex = "1.2" +regex.workspace = true bigdecimal = "0.3" serde.workspace = true serde_json.workspace = true diff --git a/libs/user-facing-errors/src/query_engine/mod.rs b/libs/user-facing-errors/src/query_engine/mod.rs index e42fbcb03f56..804ab2406533 100644 --- a/libs/user-facing-errors/src/query_engine/mod.rs +++ b/libs/user-facing-errors/src/query_engine/mod.rs @@ -68,10 +68,7 @@ pub struct UniqueKeyViolation { } #[derive(Debug, UserFacingError, Serialize)] -#[user_facing( - code = "P2003", - message = "Foreign key constraint failed on the field: `{field_name}`" -)] +#[user_facing(code = "P2003", message = "Foreign key constraint violated: `{field_name}`")] pub struct ForeignKeyViolation { /// Field name from one model from Prisma schema pub field_name: String, diff --git a/psl/psl-core/Cargo.toml b/psl/psl-core/Cargo.toml index ca1087939681..cd069d9bce37 100644 --- a/psl/psl-core/Cargo.toml +++ b/psl/psl-core/Cargo.toml @@ -22,7 +22,7 @@ chrono = { workspace = true } connection-string.workspace = true itertools.workspace = true once_cell = "1.3.1" -regex = "1.3.7" +regex.workspace = true serde.workspace = true serde_json.workspace = true enumflags2.workspace = true diff --git a/quaint/Cargo.toml b/quaint/Cargo.toml index 89507de20635..b63fe18b4941 100644 --- a/quaint/Cargo.toml +++ b/quaint/Cargo.toml @@ -79,6 +79,7 @@ futures = "0.3" url.workspace = true hex = "0.4" itertools.workspace = true +regex.workspace = true either = { version = "1.6" } base64 = { version = "0.12.3" } diff --git a/quaint/src/connector/postgres/error.rs b/quaint/src/connector/postgres/error.rs index 3dcc481eccba..e578f7aa2833 100644 --- a/quaint/src/connector/postgres/error.rs +++ b/quaint/src/connector/postgres/error.rs @@ -1,3 +1,4 @@ +use regex::Regex; use std::fmt::{Display, Formatter}; use crate::error::{DatabaseConstraint, Error, ErrorKind, Name}; @@ -28,6 +29,12 @@ impl Display for PostgresError { } } +fn extract_fk_constraint_name(message: &str) -> Option { + let re = Regex::new(r#"foreign key constraint "([^"]+)""#).unwrap(); + re.captures(message) + .and_then(|caps| caps.get(1).map(|m| m.as_str().to_string())) +} + impl From for Error { fn from(value: PostgresError) -> Self { match value.code.as_str() { @@ -89,12 +96,8 @@ impl From for Error { builder.build() } None => { - let constraint = value - .message - .split_whitespace() - .nth(10) - .and_then(|s| s.split('"').nth(1)) - .map(ToString::to_string) + // `value.message` looks like `update on table "Child" violates foreign key constraint "Child_parent_id_fkey"` + let constraint = extract_fk_constraint_name(value.message.as_str()) .map(DatabaseConstraint::Index) .unwrap_or(DatabaseConstraint::CannotParse); diff --git a/query-engine/black-box-tests/Cargo.toml b/query-engine/black-box-tests/Cargo.toml index c5f88c844dc7..42e2bacb3498 100644 --- a/query-engine/black-box-tests/Cargo.toml +++ b/query-engine/black-box-tests/Cargo.toml @@ -15,4 +15,4 @@ user-facing-errors.workspace = true insta = "1.7.1" enumflags2.workspace = true query-engine-metrics = {path = "../metrics"} -regex = "1.9.3" +regex.workspace = true diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/src/utils/querying.rs b/query-engine/connector-test-kit-rs/query-engine-tests/src/utils/querying.rs index 268fddef976b..ce64623645bd 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/src/utils/querying.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/src/utils/querying.rs @@ -34,6 +34,28 @@ macro_rules! match_connector_result { }; } +#[macro_export] +macro_rules! assert_connector_error { + ($runner:expr, $q:expr, $code:expr, $( $($matcher:pat_param)|+ $( if $pred:expr )? => $msg:expr ),*) => { + use query_tests_setup::*; + use query_tests_setup::ConnectorVersion::*; + + let connector = $runner.connector_version(); + + let mut results = match &connector { + $( + $( $matcher )|+ $( if $pred )? => $msg.to_string() + ),* + }; + + if results.len() == 0 { + panic!("No assertion failure defined for connector {connector}."); + } + + $runner.query($q).await?.assert_failure($code, Some(results)); + }; +} + #[macro_export] macro_rules! is_one_of { ($result:expr, $potential_results:expr) => { diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/ref_actions/on_delete/set_default.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/ref_actions/on_delete/set_default.rs index 131dbcf89591..9e347d476059 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/ref_actions/on_delete/set_default.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/ref_actions/on_delete/set_default.rs @@ -80,7 +80,7 @@ mod one2one_req { runner, "mutation { deleteOneParent(where: { id: 1 }) { id }}", 2003, - "Foreign key constraint failed on the field" + "Foreign key constraint violated" ); Ok(()) @@ -187,7 +187,7 @@ mod one2one_opt { runner, "mutation { deleteOneParent(where: { id: 1 }) { id }}", 2003, - "Foreign key constraint failed on the field" + "Foreign key constraint violated" ); Ok(()) @@ -293,7 +293,7 @@ mod one2many_req { runner, "mutation { deleteOneParent(where: { id: 1 }) { id }}", 2003, - "Foreign key constraint failed on the field" + "Foreign key constraint violated" ); Ok(()) @@ -397,7 +397,7 @@ mod one2many_opt { runner, "mutation { deleteOneParent(where: { id: 1 }) { id }}", 2003, - "Foreign key constraint failed on the field" + "Foreign key constraint violated" ); Ok(()) diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/ref_actions/on_update/set_default.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/ref_actions/on_update/set_default.rs index 99c2ffb63a5e..73ee612bbfc0 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/ref_actions/on_update/set_default.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/ref_actions/on_update/set_default.rs @@ -79,7 +79,7 @@ mod one2one_req { &runner, r#"mutation { updateOneParent(where: { id: 1 }, data: { uniq: "u1" }) { id }}"#, 2003, - "Foreign key constraint failed on the field" + "Foreign key constraint violated" ); Ok(()) @@ -182,7 +182,7 @@ mod one2one_opt { &runner, r#"mutation { updateOneParent(where: { id: 1 } data: { uniq: "u1" }) { id }}"#, 2003, - "Foreign key constraint failed on the field" + "Foreign key constraint violated" ); Ok(()) @@ -287,7 +287,7 @@ mod one2many_req { &runner, r#"mutation { updateOneParent(where: { id: 1 }, data: { uniq: "u1" }) { id }}"#, 2003, - "Foreign key constraint failed on the field" + "Foreign key constraint violated" ); Ok(()) @@ -390,7 +390,7 @@ mod one2many_opt { &runner, r#"mutation { updateOneParent(where: { id: 1 }, data: { uniq: "u1" }) { id }}"#, 2003, - "Foreign key constraint failed on the field" + "Foreign key constraint violated" ); Ok(()) diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/mod.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/mod.rs index 4b014fa53f69..5cd387d64f9e 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/mod.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/mod.rs @@ -27,6 +27,7 @@ mod prisma_21901; mod prisma_22007; mod prisma_22298; mod prisma_22971; +mod prisma_24072; mod prisma_5952; mod prisma_6173; mod prisma_7010; diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/prisma_24072.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/prisma_24072.rs new file mode 100644 index 000000000000..14d402ee6af6 --- /dev/null +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/prisma_24072.rs @@ -0,0 +1,54 @@ +use indoc::indoc; +use query_engine_tests::*; + +// Skip databases that don't support `onDelete: SetDefault` +#[test_suite( + schema(schema), + exclude( + MongoDb, + MySql(5.6), + MySql(5.7), + Vitess("planetscale.js"), + Vitess("planetscale.js.wasm") + ) +)] +mod prisma_24072 { + fn schema() -> String { + let schema = indoc! { + r#"model Parent { + #id(id, Int, @id) + child Child? + } + + model Child { + #id(id, Int, @id) + parent_id Int? @default(2) @unique + parent Parent? @relation(fields: [parent_id], references: [id], onDelete: NoAction) + }"# + }; + + schema.to_owned() + } + + // Deleting the parent without cascading to the child should fail with an explicitly named constraint violation, + // without any "(not available)" names. + #[connector_test] + async fn test_24072(runner: Runner) -> TestResult<()> { + insta::assert_snapshot!( + run_query!(&runner, r#"mutation { createOneParent(data: { id: 1, child: { create: { id: 1 }}}) { id }}"#), + @r###"{"data":{"createOneParent":{"id":1}}}"### + ); + + assert_connector_error!( + &runner, + "mutation { deleteOneParent(where: { id: 1 }) { id }}", + 2003, + CockroachDb(_) | Postgres(_) | SqlServer(_) | Vitess(_) => "Foreign key constraint violated: `Child_parent_id_fkey (index)`", + MySql(_) => "Foreign key constraint violated: `parent_id`", + Sqlite(_) => "Foreign key constraint violated: `foreign key`", + _ => "Foreign key constraint violated" + ); + + Ok(()) + } +} diff --git a/query-engine/connector-test-kit-rs/query-tests-setup/Cargo.toml b/query-engine/connector-test-kit-rs/query-tests-setup/Cargo.toml index cd8abc07331c..8b68821dcf87 100644 --- a/query-engine/connector-test-kit-rs/query-tests-setup/Cargo.toml +++ b/query-engine/connector-test-kit-rs/query-tests-setup/Cargo.toml @@ -19,7 +19,7 @@ thiserror = "1.0" async-trait.workspace = true nom = "7.1" itertools.workspace = true -regex = "1" +regex.workspace = true serde.workspace = true tracing.workspace = true tracing-futures = "0.2" diff --git a/query-engine/connectors/mongodb-query-connector/Cargo.toml b/query-engine/connectors/mongodb-query-connector/Cargo.toml index 05bf5968a599..e66ca4204021 100644 --- a/query-engine/connectors/mongodb-query-connector/Cargo.toml +++ b/query-engine/connectors/mongodb-query-connector/Cargo.toml @@ -12,7 +12,7 @@ itertools.workspace = true mongodb.workspace = true bson.workspace = true rand.workspace = true -regex = "1" +regex.workspace = true serde_json.workspace = true thiserror = "1.0" tokio.workspace = true diff --git a/schema-engine/connectors/mongodb-schema-connector/Cargo.toml b/schema-engine/connectors/mongodb-schema-connector/Cargo.toml index 1978cc1f6318..90e8b02f447e 100644 --- a/schema-engine/connectors/mongodb-schema-connector/Cargo.toml +++ b/schema-engine/connectors/mongodb-schema-connector/Cargo.toml @@ -22,7 +22,7 @@ tokio.workspace = true tracing.workspace = true convert_case = "0.6.0" once_cell = "1.8.0" -regex = "1.7.3" +regex.workspace = true indoc.workspace = true [dev-dependencies] diff --git a/schema-engine/connectors/sql-schema-connector/Cargo.toml b/schema-engine/connectors/sql-schema-connector/Cargo.toml index b5f70423a6e1..a380f2762e6a 100644 --- a/schema-engine/connectors/sql-schema-connector/Cargo.toml +++ b/schema-engine/connectors/sql-schema-connector/Cargo.toml @@ -34,7 +34,7 @@ chrono.workspace = true connection-string.workspace = true enumflags2.workspace = true once_cell = "1.3" -regex = "1" +regex.workspace = true serde_json.workspace = true tracing.workspace = true tracing-futures = "0.2" diff --git a/schema-engine/datamodel-renderer/Cargo.toml b/schema-engine/datamodel-renderer/Cargo.toml index ad1b0435d66b..b74352589e12 100644 --- a/schema-engine/datamodel-renderer/Cargo.toml +++ b/schema-engine/datamodel-renderer/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] once_cell = "1.15.0" psl.workspace = true -regex = "1.6.0" +regex.workspace = true base64 = "0.13.1" [dev-dependencies] diff --git a/schema-engine/sql-schema-describer/Cargo.toml b/schema-engine/sql-schema-describer/Cargo.toml index 514eac9daecf..088a26accbd9 100644 --- a/schema-engine/sql-schema-describer/Cargo.toml +++ b/schema-engine/sql-schema-describer/Cargo.toml @@ -14,7 +14,7 @@ enumflags2.workspace = true indexmap.workspace = true indoc.workspace = true once_cell = "1.3" -regex = "1.2" +regex.workspace = true serde.workspace = true tracing.workspace = true tracing-error = "0.2" From 36cb94e933c48f15df895e3b9d081d5bff29a5e4 Mon Sep 17 00:00:00 2001 From: Alberto Schiabel Date: Tue, 24 Sep 2024 10:49:22 +0200 Subject: [PATCH 4/6] chore(ci): temporarily move to Ubuntu 20.04 to circumvent cache issues in main (#5005) --- .github/workflows/test-query-engine-template.yml | 4 +++- .github/workflows/test-schema-engine.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-query-engine-template.yml b/.github/workflows/test-query-engine-template.yml index 597953bf771d..9f20fdac1514 100644 --- a/.github/workflows/test-query-engine-template.yml +++ b/.github/workflows/test-query-engine-template.yml @@ -49,7 +49,9 @@ jobs: PRISMA_ENGINE_PROTOCOL: ${{ matrix.engine_protocol }} PRISMA_RELATION_LOAD_STRATEGY: ${{ matrix.relation_load_strategy }} - runs-on: "ubuntu-${{ inputs.ubuntu }}" + runs-on: "ubuntu-20.04" + # TODO: Replace with the following once `prisma@5.20.0` is released. + # runs-on: "ubuntu-${{ inputs.ubuntu }}" steps: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 diff --git a/.github/workflows/test-schema-engine.yml b/.github/workflows/test-schema-engine.yml index 7d9f76b69a8b..88c9ba43f745 100644 --- a/.github/workflows/test-schema-engine.yml +++ b/.github/workflows/test-schema-engine.yml @@ -105,7 +105,9 @@ jobs: is_vitess: true single_threaded: true - runs-on: "ubuntu-${{ matrix.database.ubuntu || 'latest' }}" + runs-on: "ubuntu-20.04" + # TODO: Replace with the following once `prisma@5.20.0` is released. + # runs-on: "ubuntu-${{ matrix.database.ubuntu || 'latest' }}" steps: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 From b43a787d4b7bb51b83d9931b29bc34896beae4a3 Mon Sep 17 00:00:00 2001 From: Lucian Buzzo Date: Tue, 24 Sep 2024 19:54:03 +0100 Subject: [PATCH 5/6] Fix typo in connector-test-kit README (#4999) --- query-engine/connector-test-kit-rs/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/query-engine/connector-test-kit-rs/README.md b/query-engine/connector-test-kit-rs/README.md index d896358d06ed..ef8396f48045 100644 --- a/query-engine/connector-test-kit-rs/README.md +++ b/query-engine/connector-test-kit-rs/README.md @@ -83,7 +83,7 @@ drivers the code that actually communicates with the databases. See [`adapter-*` To run tests through a driver adapters, you should also configure the following environment variables: * `DRIVER_ADAPTER`: tells the test executor to use a particular driver adapter. Set to `neon`, `planetscale` or any other supported adapter. -* `DRIVER_ADAPTER_CONFIG`: a json string with the configuration for the driver adapter. This is adapter specific. See the [github workflow for driver adapter tests](.github/workflows/query-engine-driver-adapters.yml) for examples on how to configure the driver adapters. +* `DRIVER_ADAPTER_CONFIG`: a json string with the configuration for the driver adapter. This is adapter specific. See the [GitHub workflow for driver adapter tests](.github/workflows/query-engine-driver-adapters.yml) for examples on how to configure the driver adapters. * `ENGINE`: can be used to run either `wasm` or `napi` or `c-abi` version of the engine. Example: @@ -339,7 +339,7 @@ run_query!( **Accepting a snapshot update will replace, directly in your code, the expected output in the assertion.** -If you dislike the interactive view, you can also run `cargo insta accept` to automatically accept all snapshots and then use your git diff to check if everything is as intented. +If you dislike the interactive view, you can also run `cargo insta accept` to automatically accept all snapshots and then use your git diff to check if everything is as intended. ##### Without `cargo-insta` From 031f4d3fc290d071071bf02083dc6e7b783469e2 Mon Sep 17 00:00:00 2001 From: Austin Bruch Date: Thu, 26 Sep 2024 06:34:12 -0400 Subject: [PATCH 6/6] Fix typo in query engine constructor error message (#5006) --- query-engine/query-engine-node-api/src/engine.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/query-engine/query-engine-node-api/src/engine.rs b/query-engine/query-engine-node-api/src/engine.rs index 01c78b6e2c17..598aa9650617 100644 --- a/query-engine/query-engine-node-api/src/engine.rs +++ b/query-engine/query-engine-node-api/src/engine.rs @@ -76,7 +76,7 @@ impl QueryEngine { This usually happens when the javascript object passed to the constructor is missing properties for the ConstructorOptions fields that must have some value. - If you set some of these in javascript trough environment variables, make sure there are + If you set some of these in javascript through environment variables, make sure there are values for data_model, log_level, and any field that is not Option "###, );