@mikro-orm/knex 6.5.10-dev.24 → 6.5.10-dev.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.5.10-dev.24",
3
+ "version": "6.5.10-dev.25",
4
4
  "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.",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -66,7 +66,7 @@
66
66
  "@mikro-orm/core": "^6.5.9"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.5.10-dev.24",
69
+ "@mikro-orm/core": "6.5.10-dev.25",
70
70
  "better-sqlite3": "*",
71
71
  "libsql": "*",
72
72
  "mariadb": "*"
@@ -1,6 +1,6 @@
1
1
  import { inspect } from 'node:util';
2
2
  import type { Knex } from 'knex';
3
- import { type AnyEntity, type ConnectionType, type Dictionary, type EntityData, type EntityKey, type EntityManager, type EntityMetadata, type EntityName, type EntityProperty, type ExpandProperty, type FlushMode, type GroupOperator, type Loaded, LockMode, type LoggingOptions, type MetadataStorage, type ObjectQuery, PopulateHint, type PopulateOptions, type QBFilterQuery, type QBQueryOrderMap, QueryFlag, type QueryOrderMap, type QueryResult, RawQueryFragment, type RequiredEntityData } from '@mikro-orm/core';
3
+ import { type AnyEntity, type ConnectionType, type Dictionary, type EntityData, type EntityKey, type EntityManager, type EntityMetadata, type EntityName, type EntityProperty, type ExpandProperty, type FilterOptions, type FlushMode, type GroupOperator, type Loaded, LockMode, type LoggingOptions, type MetadataStorage, type ObjectQuery, PopulateHint, type PopulateOptions, type QBFilterQuery, type QBQueryOrderMap, QueryFlag, type QueryOrderMap, type QueryResult, RawQueryFragment, type RequiredEntityData } from '@mikro-orm/core';
4
4
  import { JoinType, QueryType } from './enums';
5
5
  import type { AbstractSqlDriver } from '../AbstractSqlDriver';
6
6
  import { type Alias, QueryBuilderHelper } from './QueryBuilderHelper';
@@ -147,7 +147,7 @@ export declare class QueryBuilder<Entity extends object = AnyEntity, RootAlias e
147
147
  /**
148
148
  * Apply filters to the QB where condition.
149
149
  */
150
- applyFilters(filterOptions?: Dictionary<boolean | Dictionary> | string[] | boolean): Promise<void>;
150
+ applyFilters(filterOptions?: FilterOptions): Promise<void>;
151
151
  private readonly autoJoinedPaths;
152
152
  /**
153
153
  * @internal
@@ -156,7 +156,7 @@ export declare class QueryBuilder<Entity extends object = AnyEntity, RootAlias e
156
156
  /**
157
157
  * @internal
158
158
  */
159
- applyJoinedFilters(em: EntityManager, filterOptions?: Dictionary<boolean | Dictionary> | string[] | boolean): Promise<void>;
159
+ applyJoinedFilters(em: EntityManager, filterOptions: FilterOptions | undefined): Promise<void>;
160
160
  withSubQuery(subQuery: Knex.QueryBuilder, alias: string): this;
161
161
  where(cond: QBFilterQuery<Entity>, operator?: keyof typeof GroupOperator): this;
162
162
  where(cond: string, params?: any[], operator?: keyof typeof GroupOperator): this;
@@ -280,12 +280,13 @@ class QueryBuilder {
280
280
  /**
281
281
  * @internal
282
282
  */
283
- async applyJoinedFilters(em, filterOptions = {}) {
283
+ async applyJoinedFilters(em, filterOptions) {
284
284
  for (const path of this.autoJoinedPaths) {
285
285
  const join = this.getJoinForPath(path);
286
286
  if (join.type === enums_1.JoinType.pivotJoin) {
287
287
  continue;
288
288
  }
289
+ filterOptions = core_1.QueryHelper.mergePropertyFilters(join.prop.filters, filterOptions);
289
290
  const cond = await em.applyFilters(join.prop.type, join.cond, filterOptions, 'read');
290
291
  if (core_1.Utils.hasObjectKeys(cond)) {
291
292
  // remove nested filters, we only care about scalars here, nesting would require another join branch