Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

248
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!