@mikro-orm/knex 6.2.5-dev.1 → 6.2.5-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.
- package/AbstractSqlDriver.js +1 -0
- package/package.json +2 -2
- package/query/QueryBuilder.d.ts +1 -1
- package/query/QueryBuilder.js +6 -2
package/AbstractSqlDriver.js
CHANGED
|
@@ -357,6 +357,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
|
|
|
357
357
|
let value = row[prop.name];
|
|
358
358
|
if (prop.kind === core_1.ReferenceKind.EMBEDDED && prop.object) {
|
|
359
359
|
if (prop.array && value) {
|
|
360
|
+
value = this.platform.cloneEmbeddable(value);
|
|
360
361
|
for (let i = 0; i < value.length; i++) {
|
|
361
362
|
const item = value[i];
|
|
362
363
|
value[i] = this.mapDataToFieldNames(item, false, prop.embeddedProps, options.convertCustomTypes);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/knex",
|
|
3
|
-
"version": "6.2.5-dev.
|
|
3
|
+
"version": "6.2.5-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",
|
|
@@ -66,6 +66,6 @@
|
|
|
66
66
|
"@mikro-orm/core": "^6.2.4"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mikro-orm/core": "6.2.5-dev.
|
|
69
|
+
"@mikro-orm/core": "6.2.5-dev.11"
|
|
70
70
|
}
|
|
71
71
|
}
|
package/query/QueryBuilder.d.ts
CHANGED
|
@@ -270,7 +270,7 @@ export declare class QueryBuilder<T extends object = AnyEntity> {
|
|
|
270
270
|
private ensureFromClause;
|
|
271
271
|
private ensureNotFinalized;
|
|
272
272
|
/** @ignore */
|
|
273
|
-
[inspect.custom](depth
|
|
273
|
+
[inspect.custom](depth?: number): string;
|
|
274
274
|
}
|
|
275
275
|
export interface RunQueryBuilder<T extends object> extends Omit<QueryBuilder<T>, 'getResult' | 'getSingleResult' | 'getResultList' | 'where'> {
|
|
276
276
|
where(cond: QBFilterQuery<T> | string, params?: keyof typeof GroupOperator | any[], operator?: keyof typeof GroupOperator): this;
|
package/query/QueryBuilder.js
CHANGED
|
@@ -1199,7 +1199,11 @@ class QueryBuilder {
|
|
|
1199
1199
|
const pks = this.prepareFields(meta.primaryKeys, 'sub-query');
|
|
1200
1200
|
const subQuery = this.clone(['_orderBy', '_fields']).select(pks).groupBy(pks).limit(this._limit);
|
|
1201
1201
|
// revert the on conditions added via populateWhere, we want to apply those only once
|
|
1202
|
-
Object.values(subQuery._joins)
|
|
1202
|
+
for (const join of Object.values(subQuery._joins)) {
|
|
1203
|
+
if (join.cond_) {
|
|
1204
|
+
join.cond = join.cond_;
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1203
1207
|
if (this._offset) {
|
|
1204
1208
|
subQuery.offset(this._offset);
|
|
1205
1209
|
}
|
|
@@ -1336,7 +1340,7 @@ class QueryBuilder {
|
|
|
1336
1340
|
}
|
|
1337
1341
|
/* istanbul ignore next */
|
|
1338
1342
|
/** @ignore */
|
|
1339
|
-
[util_1.inspect.custom](depth) {
|
|
1343
|
+
[util_1.inspect.custom](depth = 2) {
|
|
1340
1344
|
const object = { ...this };
|
|
1341
1345
|
const hidden = ['metadata', 'driver', 'context', 'platform', 'knex', 'type'];
|
|
1342
1346
|
Object.keys(object).filter(k => k.startsWith('_')).forEach(k => delete object[k]);
|