@mikro-orm/knex 5.7.13-dev.2 → 5.7.13-dev.20
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
CHANGED
|
@@ -270,7 +270,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
|
|
|
270
270
|
const keys = [];
|
|
271
271
|
props.forEach(prop => {
|
|
272
272
|
if (prop.fieldNames.length > 1) {
|
|
273
|
-
const param = row[prop.name] ?? prop.fieldNames.map(() => null);
|
|
273
|
+
const param = [...row[prop.name] ?? prop.fieldNames.map(() => null)];
|
|
274
274
|
const key = (row[prop.name] ?? prop.fieldNames).map(() => '?');
|
|
275
275
|
prop.fieldNames.forEach((field, idx) => {
|
|
276
276
|
if (duplicates.includes(field)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/knex",
|
|
3
|
-
"version": "5.7.13-dev.
|
|
3
|
+
"version": "5.7.13-dev.20",
|
|
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.7.12"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mikro-orm/core": "~5.7.13-dev.
|
|
70
|
-
"@mikro-orm/entity-generator": "~5.7.13-dev.
|
|
71
|
-
"@mikro-orm/migrations": "~5.7.13-dev.
|
|
69
|
+
"@mikro-orm/core": "~5.7.13-dev.20",
|
|
70
|
+
"@mikro-orm/entity-generator": "~5.7.13-dev.20",
|
|
71
|
+
"@mikro-orm/migrations": "~5.7.13-dev.20",
|
|
72
72
|
"better-sqlite3": "*",
|
|
73
73
|
"mssql": "*",
|
|
74
74
|
"mysql": "*",
|
|
@@ -106,7 +106,7 @@ class QueryBuilderHelper {
|
|
|
106
106
|
joinOneToReference(prop, ownerAlias, alias, type, cond = {}) {
|
|
107
107
|
const prop2 = prop.targetMeta.properties[prop.mappedBy || prop.inversedBy];
|
|
108
108
|
const table = this.getTableName(prop.type);
|
|
109
|
-
const schema = this.driver.getSchemaName(prop.targetMeta);
|
|
109
|
+
const schema = prop.targetMeta?.schema === '*' ? '*' : this.driver.getSchemaName(prop.targetMeta);
|
|
110
110
|
const joinColumns = prop.owner ? prop.referencedColumnNames : prop2.joinColumns;
|
|
111
111
|
const inverseJoinColumns = prop.referencedColumnNames;
|
|
112
112
|
const primaryKeys = prop.owner ? prop.joinColumns : prop2.referencedColumnNames;
|
|
@@ -631,7 +631,7 @@ class QueryBuilderHelper {
|
|
|
631
631
|
if (prop.hasConvertToDatabaseValueSQL && !this.platform.isRaw(data[k])) {
|
|
632
632
|
const quoted = this.platform.quoteValue(data[k]);
|
|
633
633
|
const sql = prop.customType.convertToDatabaseValueSQL(quoted, this.platform);
|
|
634
|
-
data[k] = this.knex.raw(sql.replace(
|
|
634
|
+
data[k] = this.knex.raw(sql.replace(/\?/g, '\\?'));
|
|
635
635
|
}
|
|
636
636
|
if (!prop.customType && (Array.isArray(data[k]) || core_1.Utils.isPlainObject(data[k]))) {
|
|
637
637
|
data[k] = JSON.stringify(data[k]);
|