小编Ian*_*gia的帖子

错误:绑定消息有 9914 个参数格式,但有 0 个参数

我正在使用 PostgresSQL,并且尝试删除列中的所有数据(我的实体由 和 组成idname,但是当我运行代码时,会出现一条错误消息。

这是代码(我使用 NestJs 和 TypeOrm):

    @Injectable()
export class ClearLinioBrands {
  constructor(
    @InjectRepository(LinioBrand)
    private linioBrandRepo: Repository<LinioBrand>,
  ) {}
  async execute(): Promise<void> {
    const existingBrands = await this.linioBrandRepo.find();
    await this.linioBrandRepo.remove(existingBrands);
  }
}
Run Code Online (Sandbox Code Playgroud)

但是,我在控制台上收到以下错误:

    @Injectable()
export class ClearLinioBrands {
  constructor(
    @InjectRepository(LinioBrand)
    private linioBrandRepo: Repository<LinioBrand>,
  ) {}
  async execute(): Promise<void> {
    const existingBrands = await this.linioBrandRepo.find();
    await this.linioBrandRepo.remove(existingBrands);
  }
}
Run Code Online (Sandbox Code Playgroud)

该表中有 115900 行,这是此行为的原因吗?我应该怎么办?

postgresql typeorm nestjs

15
推荐指数
1
解决办法
1万
查看次数

标签 统计

nestjs ×1

postgresql ×1

typeorm ×1