@mikro-orm/mariadb 7.0.0-dev.190 → 7.0.0-dev.192
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/MariaDbQueryBuilder.js +7 -22
- package/package.json +3 -3
- package/tsconfig.build.tsbuildinfo +1 -1
package/MariaDbQueryBuilder.js
CHANGED
|
@@ -67,28 +67,13 @@ export class MariaDbQueryBuilder extends QueryBuilder {
|
|
|
67
67
|
subSubQuery.select(raw(`json_arrayagg(${quotedPKs.join(', ')})`)).from(innerQuery);
|
|
68
68
|
this._limit = undefined;
|
|
69
69
|
this._offset = undefined;
|
|
70
|
-
//
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const field = hint.field.split(':')[0];
|
|
78
|
-
populate.add((prefix ? prefix + '.' : '') + field);
|
|
79
|
-
if (hint.children) {
|
|
80
|
-
addPath(hint.children, (prefix ? prefix + '.' : '') + field);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
addPath(this._populate);
|
|
85
|
-
for (const [key, join] of Object.entries(this._joins)) {
|
|
86
|
-
const path = join.path?.replace(/\[populate]|\[pivot]|:ref/g, '').replace(new RegExp(`^${meta.className}.`), '');
|
|
87
|
-
/* v8 ignore next */
|
|
88
|
-
if (!populate.has(path ?? '') && !orderByAliases.includes(join.alias)) {
|
|
89
|
-
delete this._joins[key];
|
|
90
|
-
}
|
|
91
|
-
}
|
|
70
|
+
// Save the original WHERE conditions before pruning joins
|
|
71
|
+
const originalCond = this._cond;
|
|
72
|
+
const populatePaths = this.getPopulatePaths();
|
|
73
|
+
// Remove joins that are not used for population or ordering
|
|
74
|
+
this.pruneJoinsForPagination(meta, populatePaths);
|
|
75
|
+
// Transfer WHERE conditions to ORDER BY joins (GH #6160)
|
|
76
|
+
this.transferConditionsForOrderByJoins(meta, originalCond, populatePaths);
|
|
92
77
|
const subquerySql = subSubQuery.toString();
|
|
93
78
|
const key = meta.getPrimaryProps()[0].runtimeType === 'string' ? `concat('"', ${quotedPKs.join(', ')}, '"')` : quotedPKs.join(', ');
|
|
94
79
|
const sql = `json_contains((${subquerySql}), ${key})`;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/mariadb",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.0-dev.
|
|
4
|
+
"version": "7.0.0-dev.192",
|
|
5
5
|
"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.",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./package.json": "./package.json",
|
|
@@ -50,13 +50,13 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@mikro-orm/mysql": "7.0.0-dev.
|
|
53
|
+
"@mikro-orm/mysql": "7.0.0-dev.192",
|
|
54
54
|
"kysely": "0.28.10"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@mikro-orm/core": "^6.6.4"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@mikro-orm/core": "7.0.0-dev.
|
|
60
|
+
"@mikro-orm/core": "7.0.0-dev.192"
|
|
61
61
|
}
|
|
62
62
|
}
|