@mikro-orm/core 6.6.1-dev.10 → 6.6.1-dev.11

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.
@@ -43,6 +43,7 @@ export declare abstract class DatabaseDriver<C extends Connection> implements ID
43
43
  setMetadata(metadata: MetadataStorage): void;
44
44
  getMetadata(): MetadataStorage;
45
45
  getDependencies(): string[];
46
+ protected isPopulated<T extends object>(meta: EntityMetadata<T>, prop: EntityProperty<T>, hint: PopulateOptions<T>, name?: string): boolean;
46
47
  protected processCursorOptions<T extends object, P extends string>(meta: EntityMetadata<T>, options: FindOptions<T, P, any, any>, orderBy: OrderDefinition<T>): {
47
48
  orderBy: OrderDefinition<T>[];
48
49
  where: FilterQuery<T>;
@@ -107,6 +107,15 @@ class DatabaseDriver {
107
107
  getDependencies() {
108
108
  return this.dependencies;
109
109
  }
110
+ isPopulated(meta, prop, hint, name) {
111
+ if (hint.field === prop.name || hint.field === name || hint.all) {
112
+ return true;
113
+ }
114
+ if (prop.embedded && hint.children && meta.properties[prop.embedded[0]].name === hint.field) {
115
+ return hint.children.some(c => this.isPopulated(meta, prop, c, prop.embedded[1]));
116
+ }
117
+ return false;
118
+ }
110
119
  processCursorOptions(meta, options, orderBy) {
111
120
  const { first, last, before, after, overfetch } = options;
112
121
  const limit = first ?? last;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "6.6.1-dev.10",
3
+ "version": "6.6.1-dev.11",
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.2",
66
66
  "globby": "11.1.0",
67
- "mikro-orm": "6.6.1-dev.10",
67
+ "mikro-orm": "6.6.1-dev.11",
68
68
  "reflect-metadata": "0.2.2"
69
69
  }
70
70
  }