@mikro-orm/core 6.4.7-dev.2 → 6.4.7-dev.4

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/EntityManager.js CHANGED
@@ -360,7 +360,7 @@ class EntityManager {
360
360
  if (!args && filter.cond.length > 0 && filter.args !== false) {
361
361
  throw new Error(`No arguments provided for filter '${filter.name}'`);
362
362
  }
363
- cond = await filter.cond(args, type, this, findOptions);
363
+ cond = await filter.cond(args, type, this, findOptions, entityName);
364
364
  }
365
365
  else {
366
366
  cond = filter.cond;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "6.4.7-dev.2",
3
+ "version": "6.4.7-dev.4",
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",
@@ -64,7 +64,7 @@
64
64
  "esprima": "4.0.1",
65
65
  "fs-extra": "11.3.0",
66
66
  "globby": "11.1.0",
67
- "mikro-orm": "6.4.7-dev.2",
67
+ "mikro-orm": "6.4.7-dev.4",
68
68
  "reflect-metadata": "0.2.2"
69
69
  }
70
70
  }
package/typings.d.ts CHANGED
@@ -671,7 +671,7 @@ export interface MigrationObject {
671
671
  }
672
672
  export type FilterDef = {
673
673
  name: string;
674
- cond: Dictionary | ((args: Dictionary, type: 'read' | 'update' | 'delete', em: any, options?: FindOptions<any, any, any, any> | FindOneOptions<any, any, any, any>) => Dictionary | Promise<Dictionary>);
674
+ cond: Dictionary | ((args: Dictionary, type: 'read' | 'update' | 'delete', em: any, options?: FindOptions<any, any, any, any> | FindOneOptions<any, any, any, any>, entityName?: EntityName<any>) => Dictionary | Promise<Dictionary>);
675
675
  default?: boolean;
676
676
  entity?: string[];
677
677
  args?: boolean;
@@ -104,7 +104,10 @@ class AbstractSchemaGenerator {
104
104
  }
105
105
  return calc.sort()
106
106
  .map(cls => this.metadata.find(cls))
107
- .filter(meta => schema ? [schema, '*'].includes(meta.schema) : meta.schema !== '*');
107
+ .filter(meta => {
108
+ const targetSchema = meta.schema ?? this.config.get('schema', this.platform.getDefaultSchemaName());
109
+ return schema ? [schema, '*'].includes(targetSchema) : meta.schema !== '*';
110
+ });
108
111
  }
109
112
  notImplemented() {
110
113
  throw new Error(`This method is not supported by ${this.driver.constructor.name} driver`);
@@ -24,6 +24,7 @@ class RawQueryFragment {
24
24
  }
25
25
  as(alias) {
26
26
  // TODO: to be removed in v7
27
+ /* istanbul ignore next */
27
28
  if (alias.startsWith('`') || alias.startsWith('"')) {
28
29
  return new RawQueryFragment(`${this.sql} as ${alias}`, this.params);
29
30
  }