@mikro-orm/knex 6.4.5-dev.3 → 6.4.5-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.
@@ -412,9 +412,12 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
412
412
  props.forEach(prop => {
413
413
  if (prop.fieldNames.length > 1) {
414
414
  const newFields = [];
415
- const allParam = [...row[prop.name] ?? prop.fieldNames.map(() => null)];
415
+ const allParam = [...core_1.Utils.asArray(row[prop.name]) ?? prop.fieldNames.map(() => null)];
416
+ // TODO(v7): instead of making this conditional here, the entity snapshot should respect `ownColumns`,
417
+ // but that means changing the compiled PK getters, which might be seen as breaking
418
+ const columns = allParam.length > 1 ? prop.fieldNames : prop.ownColumns;
416
419
  const newParam = [];
417
- prop.fieldNames.forEach((field, idx) => {
420
+ columns.forEach((field, idx) => {
418
421
  if (usedDups.includes(field)) {
419
422
  return;
420
423
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.4.5-dev.3",
3
+ "version": "6.4.5-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,7 +66,7 @@
66
66
  "@mikro-orm/core": "^6.4.4"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.4.5-dev.3",
69
+ "@mikro-orm/core": "6.4.5-dev.5",
70
70
  "better-sqlite3": "*",
71
71
  "libsql": "*",
72
72
  "mariadb": "*"