From b987080f79416335471606f2a0cb6f02da37522b Mon Sep 17 00:00:00 2001 From: Boris Date: Wed, 22 May 2024 15:04:49 +0800 Subject: [PATCH] fix: avoid full query sql in share page (#616) --- apps/nestjs-backend/src/features/record/record.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/nestjs-backend/src/features/record/record.service.ts b/apps/nestjs-backend/src/features/record/record.service.ts index 0efcd3f57..83e6c84fd 100644 --- a/apps/nestjs-backend/src/features/record/record.service.ts +++ b/apps/nestjs-backend/src/features/record/record.service.ts @@ -1012,8 +1012,8 @@ export class RecordService { filter, }); + queryBuilder.whereIn(`${dbTableName}.__id`, recordIds); queryBuilder.select(this.knex.ref(`${dbTableName}.__id`)); - const result = await this.prismaService .txClient() .$queryRawUnsafe<{ __id: string }[]>(queryBuilder.toQuery());