Skip to content

Commit a943513

Browse files
committed
chore: address comments
1 parent c808dd5 commit a943513

2 files changed

Lines changed: 18 additions & 9 deletions

File tree

  • packages
    • client-engine-runtime/src/interpreter
    • client/tests/functional/issues/29254-query-plan-cache-mutation

packages/client-engine-runtime/src/interpreter/render-query.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ function formatPlaceholder(placeholderFormat: PlaceholderFormat, placeholderNumb
158158
return placeholderFormat.hasNumbering ? `${placeholderFormat.prefix}${placeholderNumber}` : placeholderFormat.prefix
159159
}
160160

161-
function renderRawSql(sql: string, args: unknown[], argTypes: DeepReadonly<ArgType[]>): DeepReadonly<SqlQuery> {
161+
function renderRawSql(
162+
sql: string,
163+
args: readonly unknown[],
164+
argTypes: DeepReadonly<ArgType[]>,
165+
): DeepReadonly<SqlQuery> {
162166
return {
163167
sql,
164168
args,
Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1+
import { faker } from '@snaplet/copycat'
2+
13
import testMatrix from './_matrix'
24
// @ts-ignore
35
import type { PrismaClient } from './generated/prisma/client'
46

57
declare let prisma: PrismaClient
68

79
testMatrix.setupTestSuite(() => {
10+
const id1 = faker.database.mongodbObjectId()
11+
const id2 = faker.database.mongodbObjectId()
12+
const id3 = faker.database.mongodbObjectId()
13+
814
afterEach(async () => {
915
await prisma.item.deleteMany()
1016
})
1117

1218
beforeEach(async () => {
1319
await prisma.item.createMany({
1420
data: [
15-
{ id: 'one', price: 10 },
16-
{ id: 'two', price: 20 },
17-
{ id: 'three', price: 30 },
18-
{ id: 'four', price: 40 },
21+
{ id: id1, price: 10 },
22+
{ id: id2, price: 20 },
23+
{ id: id3, price: 30 },
1924
],
2025
})
2126
})
@@ -25,18 +30,18 @@ testMatrix.setupTestSuite(() => {
2530

2631
const result1 = await prisma.item.findMany({
2732
orderBy: ORDER_BY_NULLABLE,
28-
cursor: { id: 'one' },
33+
cursor: { id: id1 },
2934
skip: 1,
3035
take: 1,
3136
})
32-
expect(result1).toEqual([{ id: 'two', price: 20 }])
37+
expect(result1).toEqual([{ id: id2, price: 20 }])
3338

3439
const result2 = await prisma.item.findMany({
3540
orderBy: ORDER_BY_NULLABLE,
36-
cursor: { id: 'two' },
41+
cursor: { id: id2 },
3742
skip: 1,
3843
take: 1,
3944
})
40-
expect(result2).toEqual([{ id: 'three', price: 30 }])
45+
expect(result2).toEqual([{ id: id3, price: 30 }])
4146
})
4247
})

0 commit comments

Comments
 (0)