@mikro-orm/sql 7.1.5-dev.7 → 7.1.5-dev.9
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/sql",
|
|
3
|
-
"version": "7.1.5-dev.
|
|
3
|
+
"version": "7.1.5-dev.9",
|
|
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.1.4"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@mikro-orm/core": "7.1.5-dev.
|
|
56
|
+
"@mikro-orm/core": "7.1.5-dev.9"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">= 22.17.0"
|
|
@@ -389,7 +389,7 @@ export class NativeQueryBuilder {
|
|
|
389
389
|
}
|
|
390
390
|
processInsertData() {
|
|
391
391
|
const dataAsArray = Utils.asArray(this.options.data);
|
|
392
|
-
const keys = Object.keys(dataAsArray[0]);
|
|
392
|
+
const keys = dataAsArray.length > 1 ? [...new Set(dataAsArray.flatMap(row => Object.keys(row)))] : Object.keys(dataAsArray[0]);
|
|
393
393
|
const values = keys.map(() => '?');
|
|
394
394
|
const parts = [];
|
|
395
395
|
this.parts.push(`(${keys.map(key => this.quote(key)).join(', ')})`);
|