@mikro-orm/knex 6.2.1-dev.13 → 6.2.1-dev.2

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.
@@ -799,7 +799,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
799
799
  }
800
800
  const relationsToPopulate = populate.map(({ field }) => field.split(':')[0]);
801
801
  const toPopulate = meta.relations
802
- .filter(prop => prop.kind === core_1.ReferenceKind.ONE_TO_ONE && !prop.owner && !prop.lazy && !relationsToPopulate.includes(prop.name))
802
+ .filter(prop => prop.kind === core_1.ReferenceKind.ONE_TO_ONE && !prop.owner && !relationsToPopulate.includes(prop.name))
803
803
  .filter(prop => fields.length === 0 || fields.some(f => prop.name === f || prop.name.startsWith(`${String(f)}.`)))
804
804
  .map(prop => ({ field: `${prop.name}:ref`, strategy: prop.strategy }));
805
805
  return [...populate, ...toPopulate];
@@ -1205,7 +1205,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
1205
1205
  ret.unshift(...meta.primaryKeys.filter(pk => !options.fields.includes(pk)));
1206
1206
  }
1207
1207
  }
1208
- else if (!core_1.Utils.isEmpty(options.exclude) || lazyProps.some(p => !p.formula && (p.kind !== '1:1' || p.owner))) {
1208
+ else if (!core_1.Utils.isEmpty(options.exclude) || lazyProps.some(p => !p.formula)) {
1209
1209
  const props = meta.props.filter(prop => this.platform.shouldHaveColumn(prop, populate, options.exclude, false));
1210
1210
  ret.push(...props.filter(p => !lazyProps.includes(p)).map(p => p.name));
1211
1211
  addFormulas = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.2.1-dev.13",
3
+ "version": "6.2.1-dev.2",
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.0"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.2.1-dev.13"
69
+ "@mikro-orm/core": "6.2.1-dev.2"
70
70
  }
71
71
  }
@@ -231,25 +231,8 @@ class QueryBuilder {
231
231
  }
232
232
  populate.push(...children);
233
233
  }
234
- for (const p of prop.targetMeta.getPrimaryProps()) {
235
- fields.push(...this.driver.mapPropToFieldNames(this, p, alias));
236
- }
237
- if (explicitFields) {
238
- for (const field of explicitFields) {
239
- const [a, f] = this.helper.splitField(field);
240
- const p = prop.targetMeta.properties[f];
241
- if (p) {
242
- fields.push(...this.driver.mapPropToFieldNames(this, p, alias));
243
- }
244
- else {
245
- fields.push(`${a}.${f} as ${a}__${f}`);
246
- }
247
- }
248
- }
249
234
  prop.targetMeta.props
250
- .filter(prop => explicitFields
251
- ? explicitFields.includes(prop.name) || explicitFields.includes(`${alias}.${prop.name}`) || prop.primary
252
- : this.platform.shouldHaveColumn(prop, populate))
235
+ .filter(prop => explicitFields ? explicitFields.includes(prop.name) || prop.primary : this.platform.shouldHaveColumn(prop, populate))
253
236
  .forEach(prop => fields.push(...this.driver.mapPropToFieldNames(this, prop, alias)));
254
237
  return fields;
255
238
  }
@@ -189,7 +189,7 @@ class QueryBuilderHelper {
189
189
  if (schema) {
190
190
  table = `${schema}.${table}`;
191
191
  }
192
- if (join.prop.name !== '__subquery__') {
192
+ if (!join.subquery) {
193
193
  join.primaryKeys.forEach((primaryKey, idx) => {
194
194
  const right = `${join.alias}.${join.joinColumns[idx]}`;
195
195
  if (join.prop.formula) {