@mikro-orm/knex 5.8.5-dev.2 → 5.8.5-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.
@@ -289,16 +289,14 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
289
289
  const keys = [];
290
290
  props.forEach(prop => {
291
291
  if (prop.fieldNames.length > 1) {
292
- const param = [...row[prop.name] ?? prop.fieldNames.map(() => null)];
293
- const key = (row[prop.name] ?? prop.fieldNames).map(() => '?');
292
+ const param = core_1.Utils.flatten([...row[prop.name] ?? prop.fieldNames.map(() => null)]);
293
+ const key = param.map(() => '?');
294
294
  prop.fieldNames.forEach((field, idx) => {
295
- if (duplicates.includes(field)) {
296
- param.splice(idx, 1);
297
- key.splice(idx, 1);
295
+ if (!duplicates.includes(field)) {
296
+ params.push(param[idx]);
297
+ keys.push(key[idx]);
298
298
  }
299
299
  });
300
- params.push(...param);
301
- keys.push(...key);
302
300
  }
303
301
  else if (prop.customType && 'convertToDatabaseValueSQL' in prop.customType && !this.platform.isRaw(row[prop.name])) {
304
302
  keys.push(prop.customType.convertToDatabaseValueSQL('?', this.platform));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "5.8.5-dev.2",
3
+ "version": "5.8.5-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,9 +66,9 @@
66
66
  "@mikro-orm/core": "^5.8.4"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "~5.8.5-dev.2",
70
- "@mikro-orm/entity-generator": "~5.8.5-dev.2",
71
- "@mikro-orm/migrations": "~5.8.5-dev.2",
69
+ "@mikro-orm/core": "~5.8.5-dev.4",
70
+ "@mikro-orm/entity-generator": "~5.8.5-dev.4",
71
+ "@mikro-orm/migrations": "~5.8.5-dev.4",
72
72
  "better-sqlite3": "*",
73
73
  "mssql": "*",
74
74
  "mysql": "*",
@@ -77,7 +77,7 @@ class DatabaseTable {
77
77
  unsigned: prop.unsigned && this.platform.isNumericColumn(mappedType),
78
78
  autoincrement: prop.autoincrement ?? primary,
79
79
  primary,
80
- nullable: !!prop.nullable,
80
+ nullable: this.columns[field]?.nullable ?? !!prop.nullable,
81
81
  length: prop.length,
82
82
  precision: prop.precision,
83
83
  scale: prop.scale,