@mikro-orm/knex 6.2.3-dev.2 → 6.2.3-dev.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.2.3-dev.2",
3
+ "version": "6.2.3-dev.4",
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.2"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.2.3-dev.2"
69
+ "@mikro-orm/core": "6.2.3-dev.4"
70
70
  }
71
71
  }
@@ -1255,6 +1255,10 @@ class QueryBuilder {
1255
1255
  subSubQuery.__raw = true; // tag it as there is now way to check via `instanceof`
1256
1256
  this._limit = undefined;
1257
1257
  this._offset = undefined;
1258
+ if (this._fields.some(f => core_1.RawQueryFragment.isKnownFragment(f))) {
1259
+ this.select(this._fields).where({ [core_1.Utils.getPrimaryKeyHash(meta.primaryKeys)]: { $in: subSubQuery } });
1260
+ return;
1261
+ }
1258
1262
  // remove joins that are not used for population or ordering to improve performance
1259
1263
  const populate = new Set();
1260
1264
  const orderByAliases = this._orderBy