(
entityName: EntityName<Entity>,
options:
| FindOptions<Entity, Hint, any, any>
| CountOptions<Entity, Hint>
| UpdateOptions<Entity>
| DeleteOptions<Entity>,
type: 'read' | 'update' | 'delete',
)
| 495 | } |
| 496 | |
| 497 | protected async processUnionWhere<Entity extends object, Hint extends string = never>( |
| 498 | entityName: EntityName<Entity>, |
| 499 | options: |
| 500 | | FindOptions<Entity, Hint, any, any> |
| 501 | | CountOptions<Entity, Hint> |
| 502 | | UpdateOptions<Entity> |
| 503 | | DeleteOptions<Entity>, |
| 504 | type: 'read' | 'update' | 'delete', |
| 505 | ): Promise<void> { |
| 506 | if (options.unionWhere?.length) { |
| 507 | if (!this.driver.getPlatform().supportsUnionWhere()) { |
| 508 | throw new Error(`unionWhere is only supported on SQL drivers`); |
| 509 | } |
| 510 | |
| 511 | options.unionWhere = (await Promise.all( |
| 512 | options.unionWhere.map(branch => |
| 513 | this.processWhere( |
| 514 | entityName, |
| 515 | branch as FilterQuery<NoInfer<Entity>>, |
| 516 | options as FindOptions<Entity, Hint>, |
| 517 | type, |
| 518 | ), |
| 519 | ), |
| 520 | )) as ObjectQuery<Entity>[]; |
| 521 | } |
| 522 | } |
| 523 | |
| 524 | // this method only handles the problem for mongo driver, SQL drivers have their implementation inside QueryBuilder |
| 525 | protected applyDiscriminatorCondition<Entity extends object>( |
no test coverage detected