Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

247
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda