ERROR: bind message has 9914 parameter formats but 0 parameters

Viewed 3317

I'm using PostgresSQL and I'm trying to remove all the data that I have in the Columns (My Entity is composed by Id an name ), but when I run the code an error message appear:

This is the code (I'm using 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);
  }
}

However, console throws me this error:

'ERROR: bind message has 9914 parameter formats but 0 parameters'

The total row's in this Entity is 115900 rows, is this the reason for this behavior ? What should I do ?

Thanks

1 Answers

Just in case you were still looking for an answer: I ran into the same issue using Nestjs and TypeORM. There is a limit to the amount of placeholders in the query. You can specify {chunk: <chunkSize>}

I found that here

So f.e.:

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