@mikro-orm/knex 6.1.7-dev.4 → 6.1.7-dev.5

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.1.7-dev.4",
3
+ "version": "6.1.7-dev.5",
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.1.6"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.1.7-dev.4"
69
+ "@mikro-orm/core": "6.1.7-dev.5"
70
70
  }
71
71
  }
@@ -1171,7 +1171,7 @@ class QueryBuilder {
1171
1171
  const prop = this.helper.getProperty(f, a);
1172
1172
  const type = this.platform.castColumn(prop);
1173
1173
  const fieldName = this.helper.mapper(field, this.type, undefined, null);
1174
- if (!prop?.persist && !prop?.formula) {
1174
+ if (!prop?.persist && !prop?.formula && !pks.includes(fieldName)) {
1175
1175
  addToSelect.push(fieldName);
1176
1176
  }
1177
1177
  const key = (0, core_1.raw)(`min(${this.knex.ref(fieldName)}${type})`);