Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(client, sdk, cli): integrate breaking changes and update engines #13857

Merged
merged 12 commits into from
Jun 19, 2022
Merged
6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
"devDependencies": {
"@prisma/client": "workspace:*",
"@prisma/debug": "workspace:*",
"@prisma/fetch-engine": "3.16.0-14.4908cf1dde73491641a0a47fe5f3bebd2430350c",
"@prisma/fetch-engine": "3.16.0-24.e7e033759b8d20a2a51df5d48adb60b11c6ee4fc",
"@prisma/generator-helper": "workspace:*",
"@prisma/get-platform": "3.16.0-14.4908cf1dde73491641a0a47fe5f3bebd2430350c",
"@prisma/get-platform": "3.16.0-24.e7e033759b8d20a2a51df5d48adb60b11c6ee4fc",
"@prisma/migrate": "workspace:*",
"@prisma/sdk": "workspace:*",
"@prisma/studio": "0.463.0",
Expand Down Expand Up @@ -120,7 +120,7 @@
"prepublishOnly": "pnpm run build"
},
"dependencies": {
"@prisma/engines": "3.16.0-14.4908cf1dde73491641a0a47fe5f3bebd2430350c"
"@prisma/engines": "3.16.0-24.e7e033759b8d20a2a51df5d48adb60b11c6ee4fc"
},
"sideEffects": false
}
2 changes: 1 addition & 1 deletion packages/cli/src/__tests__/commands/Doctor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ it('should fail when db is empty', async () => {
await expect(result).rejects.toThrowErrorMatchingInlineSnapshot(`
P4001

The introspected database was empty: file:dev.db
The introspected database was empty.

`)
})
Expand Down
8 changes: 4 additions & 4 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@
"@opentelemetry/api": "1.1.0",
"@prisma/debug": "workspace:*",
"@prisma/engine-core": "workspace:*",
"@prisma/engines": "3.16.0-14.4908cf1dde73491641a0a47fe5f3bebd2430350c",
"@prisma/fetch-engine": "3.16.0-14.4908cf1dde73491641a0a47fe5f3bebd2430350c",
"@prisma/engines": "3.16.0-24.e7e033759b8d20a2a51df5d48adb60b11c6ee4fc",
"@prisma/fetch-engine": "3.16.0-24.e7e033759b8d20a2a51df5d48adb60b11c6ee4fc",
"@prisma/generator-helper": "workspace:*",
"@prisma/get-platform": "3.16.0-14.4908cf1dde73491641a0a47fe5f3bebd2430350c",
"@prisma/get-platform": "3.16.0-24.e7e033759b8d20a2a51df5d48adb60b11c6ee4fc",
"@prisma/migrate": "workspace:*",
"@prisma/sdk": "workspace:*",
"@swc/core": "1.2.203",
Expand Down Expand Up @@ -137,7 +137,7 @@
}
},
"dependencies": {
"@prisma/engines-version": "3.16.0-14.4908cf1dde73491641a0a47fe5f3bebd2430350c"
"@prisma/engines-version": "3.16.0-24.e7e033759b8d20a2a51df5d48adb60b11c6ee4fc"
},
"sideEffects": false
}
14 changes: 7 additions & 7 deletions packages/client/src/__tests__/__helpers__/dmmf-types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { DMMF } from '@prisma/generator-helper'
import { DMMF } from '@prisma/generator-helper'

const dmmf: DMMF.Document = {
datamodel: {
Expand Down Expand Up @@ -1214,7 +1214,7 @@ const dmmf: DMMF.Document = {
isList: false,
location: 'inputObjectTypes',
namespace: 'prisma',
type: 'UserUpdateOneRequiredWithoutPostsInput',
type: 'UserUpdateOneRequiredWithoutPostsNestedInput',
},
],
isNullable: false,
Expand Down Expand Up @@ -1634,7 +1634,7 @@ const dmmf: DMMF.Document = {
isList: false,
location: 'inputObjectTypes',
namespace: 'prisma',
type: 'PostUpdateManyWithoutAuthorInput',
type: 'PostUpdateManyWithoutAuthorNestedInput',
},
],
isNullable: false,
Expand Down Expand Up @@ -1692,7 +1692,7 @@ const dmmf: DMMF.Document = {
isList: false,
location: 'inputObjectTypes',
namespace: 'prisma',
type: 'PostUncheckedUpdateManyWithoutAuthorInput',
type: 'PostUncheckedUpdateManyWithoutAuthorNestedInput',
},
],
isNullable: false,
Expand Down Expand Up @@ -3215,7 +3215,7 @@ const dmmf: DMMF.Document = {
name: 'update',
},
],
name: 'UserUpdateOneRequiredWithoutPostsInput',
name: 'UserUpdateOneRequiredWithoutPostsNestedInput',
},
{
constraints: {
Expand Down Expand Up @@ -3732,7 +3732,7 @@ const dmmf: DMMF.Document = {
name: 'deleteMany',
},
],
name: 'PostUpdateManyWithoutAuthorInput',
name: 'PostUpdateManyWithoutAuthorNestedInput',
},
{
constraints: {
Expand Down Expand Up @@ -3956,7 +3956,7 @@ const dmmf: DMMF.Document = {
name: 'deleteMany',
},
],
name: 'PostUncheckedUpdateManyWithoutAuthorInput',
name: 'PostUncheckedUpdateManyWithoutAuthorNestedInput',
},
{
constraints: {
Expand Down
13 changes: 12 additions & 1 deletion packages/client/src/__tests__/__snapshots__/json.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,20 @@ Invalid \`prisma.user()\` invocation:

{}

Unknown arg \`hello\` in where.json.hello for type JsonFilter. Did you mean \`select\`? Available args:
Unknown arg \`hello\` in where.json.hello for type JsonFilter. Did you mean \`lt\`? Available args:
type JsonFilter {
equals?: JsonNullValueFilter | Json
path?: List<String>
string_contains?: String
string_starts_with?: String
string_ends_with?: String
array_contains?: Json | Null
array_starts_with?: Json | Null
array_ends_with?: Json | Null
lt?: Json
lte?: Json
gt?: Json
gte?: Json
not?: JsonNullValueFilter | Json
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test('raw-transaction: queryRaw', async () => {
Array [
Array [
Object {
1: 1,
1: 1n,
},
],
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ describeIf(!process.env.TEST_SKIP_COCKROACHDB)('Blog fixture: Cockroachdb', () =

test('can perform $queryRawUnsafe', async () => {
const rawQuery = await prisma.$queryRawUnsafe('SELECT 1')
expect(rawQuery[0]['?column?']).toBe(1)
expect(rawQuery[0]['?column?']).toBe(BigInt('1'))
})

test('can perform $queryRaw', async () => {
const rawQuery = await prisma.$queryRaw`SELECT 1`
expect(rawQuery[0]['?column?']).toBe(1)
expect(rawQuery[0]['?column?']).toBe(BigInt('1'))
})

test('Can do find query with client', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@ test('blog', async () => {

// Test queryRaw(string)
const rawQuery = await db.$queryRawUnsafe('SELECT 1')
expect(rawQuery[0]['1']).toBe(1)
expect(rawQuery[0]['1']).toBe(BigInt('1'))

// Test queryRaw(string, values)
const rawQueryWithValues = await db.$queryRawUnsafe('SELECT $1 AS name, $2 AS id', 'Alice', 42)

expect(rawQueryWithValues[0]).toEqual({
name: 'Alice',
id: 42,
id: BigInt('42'),
})

// Test queryRaw``
const rawQueryTemplate = await db.$queryRaw`SELECT 1`
expect(rawQueryTemplate[0]['1']).toBe(1)
expect(rawQueryTemplate[0]['1']).toBe(BigInt('1'))

// Test queryRaw`` with ${param}
const rawQueryTemplateWithParams = await db.$queryRaw`SELECT * FROM User WHERE name = ${'Alice'}`
Expand Down