@mikro-orm/knex 6.2.1-dev.7 → 6.2.1-dev.8

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 && !relationsToPopulate.includes(prop.name))
802
+ .filter(prop => prop.kind === core_1.ReferenceKind.ONE_TO_ONE && !prop.owner && !prop.lazy && !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)) {
1208
+ else if (!core_1.Utils.isEmpty(options.exclude) || lazyProps.some(p => !p.formula && (p.kind !== '1:1' || p.owner))) {
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.7",
3
+ "version": "6.2.1-dev.8",
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.7"
69
+ "@mikro-orm/core": "6.2.1-dev.8"
70
70
  }
71
71
  }