@mikro-orm/knex 6.0.0-dev.40 → 6.0.0-dev.41
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/AbstractSqlDriver.js +9 -2
- package/package.json +3 -3
package/AbstractSqlDriver.js
CHANGED
|
@@ -267,6 +267,13 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
|
|
|
267
267
|
else {
|
|
268
268
|
sql += ' ' + data.map(() => `select null as ${this.platform.quoteIdentifier(pks[0])}`).join(' union all ');
|
|
269
269
|
}
|
|
270
|
+
const addParams = (prop, row) => {
|
|
271
|
+
if (options.convertCustomTypes && prop.customType) {
|
|
272
|
+
params.push(prop.customType.convertToDatabaseValue(row[prop.name], this.platform, { key: prop.name, mode: 'query' }));
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
params.push(row[prop.name]);
|
|
276
|
+
};
|
|
270
277
|
if (fields.length > 0 || this.platform.usesDefaultKeyword()) {
|
|
271
278
|
sql += data.map(row => {
|
|
272
279
|
const keys = [];
|
|
@@ -277,10 +284,10 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
|
|
|
277
284
|
}
|
|
278
285
|
else if (prop.customType && 'convertToDatabaseValueSQL' in prop.customType && !this.platform.isRaw(row[prop.name])) {
|
|
279
286
|
keys.push(prop.customType.convertToDatabaseValueSQL('?', this.platform));
|
|
280
|
-
|
|
287
|
+
addParams(prop, row);
|
|
281
288
|
}
|
|
282
289
|
else {
|
|
283
|
-
|
|
290
|
+
addParams(prop, row);
|
|
284
291
|
keys.push('?');
|
|
285
292
|
}
|
|
286
293
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/knex",
|
|
3
|
-
"version": "6.0.0-dev.
|
|
3
|
+
"version": "6.0.0-dev.41",
|
|
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",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"sqlstring": "2.3.3"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@mikro-orm/core": "^5.6.
|
|
66
|
+
"@mikro-orm/core": "^5.6.12"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mikro-orm/core": "~6.0.0-dev.
|
|
69
|
+
"@mikro-orm/core": "~6.0.0-dev.41"
|
|
70
70
|
}
|
|
71
71
|
}
|