@mikro-orm/core
Advanced tools
@@ -113,2 +113,18 @@ import type { ConnectionType, Constructor, EntityData, EntityMetadata, EntityProperty, FilterQuery, Primary, Dictionary, IPrimaryKey, PopulateOptions, EntityDictionary, AutoPath, ObjectQuery, FilterObject, Populate, EntityName, PopulateHintOptions, Prefixes } from '../typings.js'; | ||
| populateFilter?: ObjectQuery<Entity>; | ||
| /** | ||
| * Index-friendly alternative to `$or` for conditions that span joined relations. | ||
| * Each array element becomes an independent branch combined via `UNION ALL` subquery: | ||
| * `WHERE pk IN (branch_1 UNION ALL branch_2 ... branch_N)`. | ||
| * The database plans each branch independently, enabling per-table index usage | ||
| * (e.g. GIN trigram indexes for fuzzy search across related entities). | ||
| * sql only | ||
| */ | ||
| unionWhere?: ObjectQuery<Entity>[]; | ||
| /** | ||
| * Strategy for combining `unionWhere` branches. | ||
| * - `'union-all'` (default) — skips deduplication, faster for most use cases. | ||
| * - `'union'` — deduplicates rows between branches; useful when branch overlap is very high. | ||
| * sql only | ||
| */ | ||
| unionWhereStrategy?: 'union-all' | 'union'; | ||
| /** Used for ordering of the populate queries. If not specified, the value of `options.orderBy` is used. */ | ||
@@ -203,2 +219,9 @@ populateOrderBy?: OrderDefinition<Entity>; | ||
| loggerContext?: LogContext; | ||
| /** sql only */ | ||
| unionWhere?: ObjectQuery<T>[]; | ||
| /** sql only */ | ||
| unionWhereStrategy?: 'union-all' | 'union'; | ||
| filters?: FilterOptions; | ||
| /** @internal */ | ||
| em?: EntityManager; | ||
| } | ||
@@ -228,2 +251,6 @@ export interface NativeInsertUpdateManyOptions<T> extends NativeInsertUpdateOptions<T> { | ||
| populateFilter?: ObjectQuery<T>; | ||
| /** @see FindOptions.unionWhere */ | ||
| unionWhere?: ObjectQuery<T>[]; | ||
| /** @see FindOptions.unionWhereStrategy */ | ||
| unionWhereStrategy?: 'union-all' | 'union'; | ||
| ctx?: Transaction; | ||
@@ -251,8 +278,24 @@ connectionType?: ConnectionType; | ||
| ctx?: Transaction; | ||
| /** sql only */ | ||
| unionWhere?: ObjectQuery<T>[]; | ||
| /** sql only */ | ||
| unionWhereStrategy?: 'union-all' | 'union'; | ||
| } | ||
| export interface DeleteOptions<T> extends DriverMethodOptions { | ||
| filters?: FilterOptions; | ||
| /** sql only */ | ||
| unionWhere?: ObjectQuery<T>[]; | ||
| /** sql only */ | ||
| unionWhereStrategy?: 'union-all' | 'union'; | ||
| /** @internal */ | ||
| em?: EntityManager; | ||
| } | ||
| export interface NativeDeleteOptions<T> extends DriverMethodOptions { | ||
| filters?: FilterOptions; | ||
| /** sql only */ | ||
| unionWhere?: ObjectQuery<T>[]; | ||
| /** sql only */ | ||
| unionWhereStrategy?: 'union-all' | 'union'; | ||
| /** @internal */ | ||
| em?: EntityManager; | ||
| } | ||
@@ -259,0 +302,0 @@ export interface LockOptions extends DriverMethodOptions { |
@@ -124,2 +124,3 @@ import { type Configuration } from './utils/Configuration.js'; | ||
| protected processWhere<Entity extends object, Hint extends string = never, Fields extends string = '*', Excludes extends string = never>(entityName: EntityName<Entity>, where: FilterQuery<Entity>, options: FindOptions<Entity, Hint, Fields, Excludes> | FindOneOptions<Entity, Hint, Fields, Excludes>, type: 'read' | 'update' | 'delete'): Promise<FilterQuery<Entity>>; | ||
| protected processUnionWhere<Entity extends object, Hint extends string = never>(entityName: EntityName<Entity>, options: FindOptions<Entity, Hint, any, any> | CountOptions<Entity, Hint> | UpdateOptions<Entity> | DeleteOptions<Entity>, type: 'read' | 'update' | 'delete'): Promise<void>; | ||
| protected applyDiscriminatorCondition<Entity extends object>(entityName: EntityName<Entity>, where: FilterQuery<Entity>): FilterQuery<Entity>; | ||
@@ -126,0 +127,0 @@ protected createPopulateWhere<Entity extends object>(cond: ObjectQuery<Entity>, options: FindOptions<Entity, any, any, any> | FindOneOptions<Entity, any, any, any> | CountOptions<Entity, any>): ObjectQuery<Entity>; |
+1
-1
| { | ||
| "name": "@mikro-orm/core", | ||
| "type": "module", | ||
| "version": "7.0.0-dev.291", | ||
| "version": "7.0.0-dev.292", | ||
| "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.", | ||
@@ -6,0 +6,0 @@ "exports": { |
@@ -143,2 +143,3 @@ import { EntityRepository } from '../entity/EntityRepository.js'; | ||
| supportsMultipleStatements(): boolean; | ||
| supportsUnionWhere(): boolean; | ||
| getArrayDeclarationSQL(): string; | ||
@@ -145,0 +146,0 @@ marshallArray(values: string[]): string; |
@@ -238,2 +238,5 @@ import { clone } from '../utils/clone.js'; | ||
| } | ||
| supportsUnionWhere() { | ||
| return false; | ||
| } | ||
| getArrayDeclarationSQL() { | ||
@@ -240,0 +243,0 @@ return 'text'; |
+1
-1
@@ -126,3 +126,3 @@ import { clone } from './clone.js'; | ||
| static PK_SEPARATOR = '~~~'; | ||
| static #ORM_VERSION = '7.0.0-dev.291'; | ||
| static #ORM_VERSION = '7.0.0-dev.292'; | ||
| /** | ||
@@ -129,0 +129,0 @@ * Checks if the argument is instance of `Object`. Returns false for arrays. |
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1277994
0.22%28194
0.22%