@mikro-orm/sql 7.2.2-dev.3 → 7.2.2-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.
@@ -97,12 +97,12 @@ export class MsSqlNativeQueryBuilder extends NativeQueryBuilder {
97
97
  compileUpsert() {
98
98
  const clause = this.options.onConflict;
99
99
  const dataAsArray = Utils.asArray(this.options.data);
100
- const keys = Object.keys(dataAsArray[0]);
100
+ const keys = [...new Set(dataAsArray.flatMap(data => Object.keys(data)))];
101
101
  const values = keys.map(() => '?');
102
102
  const parts = [];
103
103
  for (const data of dataAsArray) {
104
104
  for (const key of keys) {
105
- this.params.push(data[key]);
105
+ this.params.push(data[key] ?? null);
106
106
  }
107
107
  parts.push(`(${values.join(', ')})`);
108
108
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/sql",
3
- "version": "7.2.2-dev.3",
3
+ "version": "7.2.2-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
  "keywords": [
6
6
  "data-mapper",
@@ -53,7 +53,7 @@
53
53
  "@mikro-orm/core": "^7.2.1"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.2.2-dev.3"
56
+ "@mikro-orm/core": "7.2.2-dev.5"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"