Skip to content

Commit

Permalink
fix(client, sdk, cli): integrate breaking changes and update engines (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
aqrln committed Jun 19, 2022
1 parent b4de6f8 commit 8e03e2c
Show file tree
Hide file tree
Showing 31 changed files with 2,566 additions and 3,969 deletions.
6 changes: 3 additions & 3 deletions packages/cli/package.json
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
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
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
@@ -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
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
Expand Up @@ -18,7 +18,7 @@ test('raw-transaction: queryRaw', async () => {
Array [
Array [
Object {
1: 1,
1: 1n,
},
],
]
Expand Down
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
6 changes: 3 additions & 3 deletions packages/client/src/__tests__/integration/happy/blog/test.ts
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

0 comments on commit 8e03e2c

Please sign in to comment.