From 1b17f29914cf1b1eb0fd89925e8ff49b65e54ae8 Mon Sep 17 00:00:00 2001 From: Prismo <52275815+prisma-bot@users.noreply.github.com> Date: Mon, 10 Jul 2023 14:05:18 +0200 Subject: [PATCH] chore(deps): update engines to 4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b (#20115) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jan Piotrowski Co-authored-by: Joël Galeran Co-authored-by: Alexey Orlenko --- packages/client/package.json | 2 +- packages/engines/package.json | 2 +- packages/fetch-engine/package.json | 2 +- packages/internals/package.json | 2 +- packages/migrate/package.json | 2 +- .../__snapshots__/cockroachdb.test.ts.snap | 74 +------------------ .../src/__tests__/DbPull/cockroachdb.test.ts | 18 +++-- packages/migrate/src/__tests__/rpc.test.ts | 18 +++-- pnpm-lock.yaml | 28 +++---- 9 files changed, 43 insertions(+), 105 deletions(-) diff --git a/packages/client/package.json b/packages/client/package.json index d5044d394c27..a8c73f97027a 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -153,7 +153,7 @@ } }, "dependencies": { - "@prisma/engines-version": "4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c" + "@prisma/engines-version": "4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b" }, "sideEffects": false } diff --git a/packages/engines/package.json b/packages/engines/package.json index da1954f3da87..44131a515f0c 100644 --- a/packages/engines/package.json +++ b/packages/engines/package.json @@ -8,7 +8,7 @@ "author": "Tim Suchanek ", "devDependencies": { "@prisma/debug": "workspace:*", - "@prisma/engines-version": "4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c", + "@prisma/engines-version": "4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b", "@prisma/fetch-engine": "workspace:*", "@prisma/get-platform": "workspace:*", "@swc/core": "1.3.64", diff --git a/packages/fetch-engine/package.json b/packages/fetch-engine/package.json index 62a60eed11f6..4be6a66e6f6a 100644 --- a/packages/fetch-engine/package.json +++ b/packages/fetch-engine/package.json @@ -15,7 +15,7 @@ "bugs": "https://github.com/prisma/prisma/issues", "enginesOverride": {}, "devDependencies": { - "@prisma/engines-version": "4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c", + "@prisma/engines-version": "4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b", "@swc/core": "1.3.64", "@swc/jest": "0.2.26", "@types/jest": "29.5.2", diff --git a/packages/internals/package.json b/packages/internals/package.json index 25326c36cace..1f6cb44ae8eb 100644 --- a/packages/internals/package.json +++ b/packages/internals/package.json @@ -48,7 +48,7 @@ "@prisma/fetch-engine": "workspace:*", "@prisma/generator-helper": "workspace:*", "@prisma/get-platform": "workspace:*", - "@prisma/prisma-schema-wasm": "4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c", + "@prisma/prisma-schema-wasm": "4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b", "archiver": "5.3.1", "arg": "5.0.2", "checkpoint-client": "1.1.24", diff --git a/packages/migrate/package.json b/packages/migrate/package.json index e181604a3902..cbafd533d474 100644 --- a/packages/migrate/package.json +++ b/packages/migrate/package.json @@ -17,7 +17,7 @@ "version": "latest" }, "devDependencies": { - "@prisma/engines-version": "4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c", + "@prisma/engines-version": "4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b", "@prisma/generator-helper": "workspace:*", "@prisma/internals": "workspace:*", "@swc/core": "1.3.64", diff --git a/packages/migrate/src/__tests__/DbPull/__snapshots__/cockroachdb.test.ts.snap b/packages/migrate/src/__tests__/DbPull/__snapshots__/cockroachdb.test.ts.snap index 2406932e908d..f3bac51f955f 100644 --- a/packages/migrate/src/__tests__/DbPull/__snapshots__/cockroachdb.test.ts.snap +++ b/packages/migrate/src/__tests__/DbPull/__snapshots__/cockroachdb.test.ts.snap @@ -74,43 +74,6 @@ enum Role { `; -exports[`cockroachdb basic introspection (with cockroach provider) --url 6`] = ` -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "postgresql://prisma@localhost:26257/tests-migrate-db-pull-cockroachdb" -} - -model Post { - id String @id - createdAt DateTime @default(now()) - updatedAt DateTime @default(dbgenerated("'1970-01-01 00:00:00'::TIMESTAMP")) - published Boolean @default(false) - title String - content String? - authorId String? - jsonData Json? - coinflips Boolean[] - User User? @relation(fields: [authorId], references: [id]) -} - -model User { - id String @id - email String @unique(map: "User.email") - name String? - Post Post[] -} - -enum Role { - USER - ADMIN -} - -`; - exports[`cockroachdb basic introspection (with cockroachdb provider) 2`] = ` generator client { provider = "prisma-client-js" @@ -148,39 +111,4 @@ enum Role { `; -exports[`cockroachdb basic introspection (with postgresql provider) 2`] = ` -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = env("TEST_COCKROACH_URI_MIGRATE") -} - -model Post { - id String @id - createdAt DateTime @default(now()) - updatedAt DateTime @default(dbgenerated("'1970-01-01 00:00:00'::TIMESTAMP")) - published Boolean @default(false) - title String - content String? - authorId String? - jsonData Json? - coinflips Boolean[] - User User? @relation(fields: [authorId], references: [id]) -} - -model User { - id String @id - email String @unique(map: "User.email") - name String? - Post Post[] -} - -enum Role { - USER - ADMIN -} - -`; +exports[`cockroachdb basic introspection (with postgresql provider) --url should fail 2`] = ``; diff --git a/packages/migrate/src/__tests__/DbPull/cockroachdb.test.ts b/packages/migrate/src/__tests__/DbPull/cockroachdb.test.ts index 59d2cd706a2b..d9a4c40d1ccc 100644 --- a/packages/migrate/src/__tests__/DbPull/cockroachdb.test.ts +++ b/packages/migrate/src/__tests__/DbPull/cockroachdb.test.ts @@ -71,12 +71,16 @@ describeIf(!process.env.TEST_SKIP_COCKROACHDB)('cockroachdb', () => { expect(ctx.mocked['console.error'].mock.calls.join('\n')).toMatchInlineSnapshot(``) }) - test('basic introspection (with postgresql provider)', async () => { + test('basic introspection (with postgresql provider) should fail', async () => { ctx.fixture('introspection/cockroachdb') const introspect = new DbPull() const result = introspect.parse(['--print', '--schema', 'with-postgresql-provider.prisma']) - await expect(result).resolves.toMatchInlineSnapshot(``) - expect(ctx.mocked['console.log'].mock.calls.join('\n')).toMatchSnapshot() + await expect(result).rejects.toThrowErrorMatchingInlineSnapshot(` + You are trying to connect to a CockroachDB database, but the provider in your Prisma schema is \`postgresql\`. Please change it to \`cockroachdb\`. + + + `) + expect(ctx.mocked['console.log'].mock.calls.join('\n')).toMatchInlineSnapshot(``) expect(ctx.mocked['console.info'].mock.calls.join('\n')).toMatchInlineSnapshot(``) expect(ctx.mocked['console.error'].mock.calls.join('\n')).toMatchInlineSnapshot(``) }) @@ -101,7 +105,7 @@ describeIf(!process.env.TEST_SKIP_COCKROACHDB)('cockroachdb', () => { expect(ctx.mocked['console.error'].mock.calls.join('\n')).toMatchInlineSnapshot(``) }) - test('basic introspection (with cockroach provider) --url ', async () => { + test('basic introspection (with postgresql provider) --url should fail', async () => { ctx.fixture('introspection/cockroachdb') const introspect = new DbPull() const result = introspect.parse([ @@ -111,7 +115,11 @@ describeIf(!process.env.TEST_SKIP_COCKROACHDB)('cockroachdb', () => { '--schema', 'with-postgresql-provider.prisma', ]) - await expect(result).resolves.toMatchInlineSnapshot(``) + await expect(result).rejects.toThrowErrorMatchingInlineSnapshot(` + You are trying to connect to a CockroachDB database, but the provider in your Prisma schema is \`postgresql\`. Please change it to \`cockroachdb\`. + + + `) expect(ctx.mocked['console.log'].mock.calls.join('\n')).toMatchSnapshot() expect(ctx.mocked['console.info'].mock.calls.join('\n')).toMatchInlineSnapshot(``) expect(ctx.mocked['console.error'].mock.calls.join('\n')).toMatchInlineSnapshot(``) diff --git a/packages/migrate/src/__tests__/rpc.test.ts b/packages/migrate/src/__tests__/rpc.test.ts index e1148e58b928..2305fc0547c3 100644 --- a/packages/migrate/src/__tests__/rpc.test.ts +++ b/packages/migrate/src/__tests__/rpc.test.ts @@ -515,8 +515,9 @@ describe('markMigrationApplied', () => { }) describe('schemaPush', () => { - // The Prisma CLI creates the SQLite database file if it doesn't exist before calling the RPC - it('should throw if SQLite database file is missing', async () => { + // Note that the Prisma CLI creates the SQLite database file if it doesn't exist before calling the RPC + // Since 5.0.0 this RPC does not error anymore if the SQLite database file is missing + it('should succeed if SQLite database file is missing', async () => { ctx.fixture('schema-only-sqlite') const schemaPath = (await getSchemaPath())! const migrate = new Migrate(schemaPath) @@ -526,12 +527,13 @@ describe('schemaPush', () => { schema: schema, }) - await expect(result).rejects.toMatchInlineSnapshot(` - P1003 - - Database dev.db does not exist at dev.db - - `) + await expect(result).resolves.toMatchInlineSnapshot(` + { + executedSteps: 1, + unexecutable: [], + warnings: [], + } + `) migrate.stop() }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6e9498960def..44095442b4f3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -224,7 +224,7 @@ importers: '@opentelemetry/semantic-conventions': 1.14.0 '@prisma/debug': workspace:* '@prisma/engines': workspace:* - '@prisma/engines-version': 4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c + '@prisma/engines-version': 4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b '@prisma/fetch-engine': workspace:* '@prisma/generator-helper': workspace:* '@prisma/get-platform': workspace:* @@ -291,7 +291,7 @@ importers: yo: 4.3.1 zx: 7.2.2 dependencies: - '@prisma/engines-version': 4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c + '@prisma/engines-version': 4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b devDependencies: '@codspeed/benchmark.js-plugin': 2.0.0_benchmark@2.1.4 '@faker-js/faker': 8.0.2 @@ -399,7 +399,7 @@ importers: packages/engines: specifiers: '@prisma/debug': workspace:* - '@prisma/engines-version': 4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c + '@prisma/engines-version': 4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b '@prisma/fetch-engine': workspace:* '@prisma/get-platform': workspace:* '@swc/core': 1.3.64 @@ -411,7 +411,7 @@ importers: typescript: 4.9.5 devDependencies: '@prisma/debug': link:../debug - '@prisma/engines-version': 4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c + '@prisma/engines-version': 4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b '@prisma/fetch-engine': link:../fetch-engine '@prisma/get-platform': link:../get-platform '@swc/core': 1.3.64 @@ -425,7 +425,7 @@ importers: packages/fetch-engine: specifiers: '@prisma/debug': workspace:* - '@prisma/engines-version': 4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c + '@prisma/engines-version': 4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b '@prisma/get-platform': workspace:* '@swc/core': 1.3.64 '@swc/jest': 0.2.26 @@ -471,7 +471,7 @@ importers: temp-dir: 2.0.0 tempy: 1.0.1 devDependencies: - '@prisma/engines-version': 4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c + '@prisma/engines-version': 4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b '@swc/core': 1.3.64 '@swc/jest': 0.2.26_@swc+core@1.3.64 '@types/jest': 29.5.2 @@ -651,7 +651,7 @@ importers: '@prisma/fetch-engine': workspace:* '@prisma/generator-helper': workspace:* '@prisma/get-platform': workspace:* - '@prisma/prisma-schema-wasm': 4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c + '@prisma/prisma-schema-wasm': 4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b '@swc/core': 1.2.204 '@swc/jest': 0.2.26 '@types/jest': 29.5.2 @@ -707,7 +707,7 @@ importers: '@prisma/fetch-engine': link:../fetch-engine '@prisma/generator-helper': link:../generator-helper '@prisma/get-platform': link:../get-platform - '@prisma/prisma-schema-wasm': 4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c + '@prisma/prisma-schema-wasm': 4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b archiver: 5.3.1 arg: 5.0.2 checkpoint-client: 1.1.24 @@ -760,7 +760,7 @@ importers: packages/migrate: specifiers: '@prisma/debug': workspace:* - '@prisma/engines-version': 4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c + '@prisma/engines-version': 4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b '@prisma/generator-helper': workspace:* '@prisma/get-platform': workspace:* '@prisma/internals': workspace:* @@ -820,7 +820,7 @@ importers: strip-indent: 3.0.0 ts-pattern: 4.3.0 devDependencies: - '@prisma/engines-version': 4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c + '@prisma/engines-version': 4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b '@prisma/generator-helper': link:../generator-helper '@prisma/internals': link:../internals '@swc/core': 1.3.64 @@ -3035,8 +3035,8 @@ packages: dev: true optional: true - /@prisma/engines-version/4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c: - resolution: {integrity: sha512-Cqt7ZKVu3vrwZj32DfUBrMG36sLcF8r/fwHEUhbJTZG5XOtHBkpoPj8k55SBY8zr6987G3KcVIYu2RYFlctEXw==} + /@prisma/engines-version/4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b: + resolution: {integrity: sha512-scxATP6Z9/L8R7NohsD7CYgq2IDXBiGGTNATOAMylLFl6/AM14Ds7vCDq89Ct+9DWualEWTkhOchWvSMC6Tzrw==} /@prisma/mini-proxy/0.9.0: resolution: {integrity: sha512-ZfgNSkQJ+Ut3c/O+BJ1/VEx1NUsQiP7O0H7Lzwf82cwVRHzxGpMKgfOzB7otMKdyAw+9kvsBD4esFzWKgopYFg==} @@ -3044,8 +3044,8 @@ packages: hasBin: true dev: true - /@prisma/prisma-schema-wasm/4.17.0-24.e992c91512a236fad14c1961a7e0cb10f43f6f5c: - resolution: {integrity: sha512-hLAQVIl61jLzU7A/7llHJvjVfLTOLejdotGZYqcmij39VkIYEdmvni6vcf8oZbpq89WZzwRRK3cKggkZKBQ3ow==} + /@prisma/prisma-schema-wasm/4.17.0-25.5f09abedf63bf38cdf856d38d49c0699b1f0002b: + resolution: {integrity: sha512-MiQqMsH02cZyncRPciYX9Um/hwkkZTtVoCU1bzUyOb3QQS/FjEOvvinAaOpJjzViKCYc+c1vlymGW4zArFLNCA==} dev: false /@prisma/studio-common/0.487.0: