Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

246
Visualizações
TypeOrm update, change of toSql from FindOperators to QueryBuilder

So I work on a project which use the function toSql but an upgrade of typeOrm make the method change to another element I'm trying to make my code work again and I didn't find anything on the web.

So the PR of the change is this one : https://github.com/typeorm/typeorm/pull/6797

The code where I was using the function :

import { Connection, FindOperator } from 'typeorm';

export abstract class BaseOperator<T> extends FindOperator<T> {
  protected constructor(private opType: string, value: FindOperator<T> | T) {
    // @ts-ignore
    super(opType, value, true, false);
  }

  abstract buildSql(
    connection: Connection,
    aliasPath: string,
    parameters: string[],
  ): string;

  public toSql(
    connection: Connection,
    aliasPath: string,
    parameters: string[],
  ): string {
    // @ts-ignore
    if (this._type === this.opType) {
      return this.buildSql(connection, aliasPath, parameters);
    }
    return super.toSql(connection, aliasPath, parameters);
  }
}

Now I've got some request which returns me an error : TypeError: Unsupported FindOperator Function

Hope someone can help me to find out how to make my code work again. Ty !

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda