@mikro-orm/sql 7.2.12-dev.9 → 7.2.13-dev.0

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/README.md CHANGED
@@ -201,6 +201,10 @@ You can find example integrations for some popular frameworks in the [`mikro-orm
201
201
 
202
202
  - [Express + SQLite](https://github.com/mikro-orm/express-js-example-app)
203
203
 
204
+ ## Supported Versions
205
+
206
+ New features and bug fixes land in the latest major version. The previous major version keeps receiving fixes for high and critical severity vulnerabilities for 12 months after the next major is released, and reaches end of life after that. See the [security policy](SECURITY.md) for the current status of each version and for how to report a vulnerability.
207
+
204
208
  ## Contributing
205
209
 
206
210
  Contributions, issues and feature requests are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on the process for submitting pull requests to us.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/sql",
3
- "version": "7.2.12-dev.9",
3
+ "version": "7.2.13-dev.0",
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
  "keywords": [
6
6
  "data-mapper",
@@ -50,10 +50,10 @@
50
50
  "kysely": "0.29.9"
51
51
  },
52
52
  "devDependencies": {
53
- "@mikro-orm/core": "^7.2.11"
53
+ "@mikro-orm/core": "^7.2.12"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.2.12-dev.9"
56
+ "@mikro-orm/core": "7.2.13-dev.0"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"
@@ -410,13 +410,19 @@ export class QueryBuilder {
410
410
  * @internal
411
411
  */
412
412
  async applyJoinedFilters(em, filterOptions) {
413
+ const joins = Object.values(this.#state.joins);
413
414
  for (const path of this.#state.autoJoinedPaths) {
414
415
  const join = this.getJoinForPath(path);
415
416
  if (join.type === JoinType.pivotJoin) {
416
417
  continue;
417
418
  }
418
- filterOptions = QueryHelper.mergePropertyFilters(join.prop.filters, filterOptions);
419
- let cond = await em.applyFilters(join.prop.targetMeta.class, join.cond, filterOptions, 'read');
419
+ // nested joins inherit the overrides of their ancestor relations
420
+ const chain = [join];
421
+ for (let parent; (parent = joins.find(j => j.alias === chain[0].ownerAlias));) {
422
+ chain.unshift(parent);
423
+ }
424
+ const joinFilters = chain.reduce((acc, j) => QueryHelper.mergePropertyFilters(j.prop.filters, acc), filterOptions);
425
+ let cond = await em.applyFilters(join.prop.targetMeta.class, join.cond, joinFilters, 'read');
420
426
  const criteriaNode = CriteriaNodeFactory.createNode(this.metadata, join.prop.targetMeta.class, cond);
421
427
  cond = criteriaNode.process(this, {
422
428
  matchPopulateJoins: true,