postgresql - 错误 : bind message has 9914 parameter formats but 0 parameters

标签 postgresql pagination nestjs typeorm

我正在使用 PostgresSQL 并且我正在尝试删除列中的所有数据(我的实体由 Id an name 组成),但是当我运行代码时出现错误消息:
这是代码(我使用的是 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);
  }
}
但是,控制台向我抛出此错误:
'错误:绑定(bind)消息有 9914 个参数格式,但有 0 个参数'
此实体中的总行数为 115900 行,这是此行为的原因吗?我该怎么办 ?
谢谢

最佳答案

以防万一您仍在寻找答案:
我使用 Nestjs 和 TypeORM 遇到了同样的问题。查询中的占位符数量有限制。您可以指定 {chunk: <chunkSize>}我发现 here
所以例如:

await this.linioBrandRepo.remove(existingBrands, {chunk: 100});

关于postgresql - 错误 : bind message has 9914 parameter formats but 0 parameters,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66906294/

相关文章:

ruby-on-rails - 堆栈级别太深,即使递归调用在函数末尾?

nestjs - 如何在 NestJS Controller 中获取表单数据

html - 所选数据(静态选择框)在编辑 View 中不显示

限制为 1 的 PostgreSQL 慢速查询并按不需要的 where 条件排序

postgresql - PL/PgSQL : No function matches the given name and argument types. 您可能需要添加显式类型转换

datagrid - 如何在 Clarity 数据网格中以编程方式移动到特定页面

java - hibernate 按可能为空值的嵌套实体字段排序

Grails 命令对象和分页

javascript - 在 Nest JS 中导入 dto 类

javascript - 请求范围的服务