@mikro-orm/knex 6.0.0-dev.36 → 6.0.0-dev.38
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/index.mjs +2 -1
- package/package.json +3 -3
- package/query/QueryBuilder.js +21 -1
package/index.mjs
CHANGED
|
@@ -34,6 +34,7 @@ export const ConfigurationLoader = mod.ConfigurationLoader;
|
|
|
34
34
|
export const Connection = mod.Connection;
|
|
35
35
|
export const ConnectionException = mod.ConnectionException;
|
|
36
36
|
export const ConstraintViolationException = mod.ConstraintViolationException;
|
|
37
|
+
export const CreateRequestContext = mod.CreateRequestContext;
|
|
37
38
|
export const CriteriaNode = mod.CriteriaNode;
|
|
38
39
|
export const CriteriaNodeFactory = mod.CriteriaNodeFactory;
|
|
39
40
|
export const Cursor = mod.Cursor;
|
|
@@ -51,6 +52,7 @@ export const DoubleType = mod.DoubleType;
|
|
|
51
52
|
export const DriverException = mod.DriverException;
|
|
52
53
|
export const Embeddable = mod.Embeddable;
|
|
53
54
|
export const Embedded = mod.Embedded;
|
|
55
|
+
export const EnsureRequestContext = mod.EnsureRequestContext;
|
|
54
56
|
export const Entity = mod.Entity;
|
|
55
57
|
export const EntityAssigner = mod.EntityAssigner;
|
|
56
58
|
export const EntityCaseNamingStrategy = mod.EntityCaseNamingStrategy;
|
|
@@ -169,7 +171,6 @@ export const Unique = mod.Unique;
|
|
|
169
171
|
export const UniqueConstraintViolationException = mod.UniqueConstraintViolationException;
|
|
170
172
|
export const UnitOfWork = mod.UnitOfWork;
|
|
171
173
|
export const UnknownType = mod.UnknownType;
|
|
172
|
-
export const UseRequestContext = mod.UseRequestContext;
|
|
173
174
|
export const Utils = mod.Utils;
|
|
174
175
|
export const UuidType = mod.UuidType;
|
|
175
176
|
export const ValidationError = mod.ValidationError;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/knex",
|
|
3
|
-
"version": "6.0.0-dev.
|
|
3
|
+
"version": "6.0.0-dev.38",
|
|
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",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"sqlstring": "2.3.3"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@mikro-orm/core": "^5.6.
|
|
66
|
+
"@mikro-orm/core": "^5.6.9"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mikro-orm/core": "~6.0.0-dev.
|
|
69
|
+
"@mikro-orm/core": "~6.0.0-dev.38"
|
|
70
70
|
}
|
|
71
71
|
}
|
package/query/QueryBuilder.js
CHANGED
|
@@ -466,7 +466,27 @@ class QueryBuilder {
|
|
|
466
466
|
if (this._joinedProps.size > 0) {
|
|
467
467
|
res = this.driver.mergeJoinedResult(res, this.mainAlias.metadata);
|
|
468
468
|
}
|
|
469
|
-
|
|
469
|
+
const entities = [];
|
|
470
|
+
function propagatePopulateHint(entity, hint) {
|
|
471
|
+
(0, core_1.helper)(entity).__serializationContext.populate ??= hint;
|
|
472
|
+
hint.forEach(pop => {
|
|
473
|
+
const value = entity[pop.field];
|
|
474
|
+
if (core_1.Utils.isEntity(value, true)) {
|
|
475
|
+
(0, core_1.helper)(value).populated();
|
|
476
|
+
propagatePopulateHint(value, pop.children ?? []);
|
|
477
|
+
}
|
|
478
|
+
else if (core_1.Utils.isCollection(value)) {
|
|
479
|
+
value.populated();
|
|
480
|
+
value.getItems(false).forEach(item => propagatePopulateHint(item, pop.children ?? []));
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
for (const r of res) {
|
|
485
|
+
const entity = this.em.map(this.mainAlias.entityName, r, { schema: this._schema });
|
|
486
|
+
propagatePopulateHint(entity, this._populate);
|
|
487
|
+
entities.push(entity);
|
|
488
|
+
}
|
|
489
|
+
return entities;
|
|
470
490
|
}
|
|
471
491
|
/**
|
|
472
492
|
* Executes the query, returning the first result or null
|