@mikro-orm/knex 7.0.0-dev.69 → 7.0.0-dev.70
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/PivotCollectionPersister.js +8 -21
- package/package.json +2 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Utils, } from '@mikro-orm/core';
|
|
2
1
|
class InsertStatement {
|
|
3
2
|
keys;
|
|
4
3
|
data;
|
|
@@ -113,27 +112,15 @@ export class PivotCollectionPersister {
|
|
|
113
112
|
items[insert.order] = insert.getData();
|
|
114
113
|
}
|
|
115
114
|
items = items.filter(i => i);
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
loggerContext: this.loggerContext,
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
/* v8 ignore start */
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
await Utils.runSerial(items, item => {
|
|
131
|
-
return this.driver.createQueryBuilder(this.meta.className, this.ctx, 'write', false, this.loggerContext)
|
|
132
|
-
.withSchema(this.schema)
|
|
133
|
-
.insert(item)
|
|
134
|
-
.execute('run', false);
|
|
115
|
+
for (let i = 0; i < items.length; i += this.batchSize) {
|
|
116
|
+
const chunk = items.slice(i, i + this.batchSize);
|
|
117
|
+
await this.driver.nativeInsertMany(this.meta.className, chunk, {
|
|
118
|
+
ctx: this.ctx,
|
|
119
|
+
schema: this.schema,
|
|
120
|
+
convertCustomTypes: false,
|
|
121
|
+
processCollections: false,
|
|
122
|
+
loggerContext: this.loggerContext,
|
|
135
123
|
});
|
|
136
124
|
}
|
|
137
|
-
/* v8 ignore stop */
|
|
138
125
|
}
|
|
139
126
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/knex",
|
|
3
|
-
"version": "7.0.0-dev.
|
|
3
|
+
"version": "7.0.0-dev.70",
|
|
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
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -57,6 +57,6 @@
|
|
|
57
57
|
"@mikro-orm/core": "^6.6.1"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@mikro-orm/core": "7.0.0-dev.
|
|
60
|
+
"@mikro-orm/core": "7.0.0-dev.70"
|
|
61
61
|
}
|
|
62
62
|
}
|