Skip to content

Commit

Permalink
Revert "test: Fix the typeorm tests with negative fetch and my sql"
Browse files Browse the repository at this point in the history
This reverts commit 9bfe290.

# Conflicts:
#	packages/query-typeorm/src/services/typeorm-query.service.ts
  • Loading branch information
ValentinVignal committed Apr 5, 2024
1 parent f02c81d commit 066732f
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions packages/query-typeorm/src/services/typeorm-query.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
UpdateOneOptions
} from '@ptc-org/nestjs-query-core'
import { DeleteResult, FindOptionsWhere, Repository } from 'typeorm'
import { DriverUtils } from 'typeorm/driver/DriverUtils'
import { QueryDeepPartialEntity } from 'typeorm/query-builder/QueryPartialEntity'
import { UpdateResult } from 'typeorm/query-builder/result/UpdateResult'

Expand Down Expand Up @@ -56,8 +55,6 @@ export class TypeOrmQueryService<Entity>

readonly useSoftDelete: boolean

private readonly isMySQL: boolean

constructor(
readonly repo: Repository<Entity>,
opts?: TypeOrmQueryServiceOpts<Entity>
Expand All @@ -66,8 +63,6 @@ export class TypeOrmQueryService<Entity>

this.filterQueryBuilder = opts?.filterQueryBuilder ?? new FilterQueryBuilder<Entity>(this.repo)
this.useSoftDelete = opts?.useSoftDelete ?? false

this.isMySQL = DriverUtils.isMySQLFamily(repo.manager.connection.driver)
}

// eslint-disable-next-line @typescript-eslint/naming-convention
Expand All @@ -89,9 +84,6 @@ export class TypeOrmQueryService<Entity>
* @param query - The Query used to filter, page, and sort rows.
*/
public async query(query: Query<Entity>, opts?: QueryOptions<Entity>): Promise<Entity[]> {
if (this.isMySQL && query.paging?.offset && !query.paging?.limit) {
query = { ...query, paging: { ...query.paging, limit: Number.MAX_SAFE_INTEGER } }
}
const qb = this.filterQueryBuilder.select(query)

if (opts?.withDeleted) {
Expand Down

0 comments on commit 066732f

Please sign in to comment.