@mikro-orm/knex 6.4.7-dev.18 → 6.4.7-dev.19

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.
@@ -59,12 +59,15 @@ class MsSqlQueryCompiler extends MonkeyPatchable_1.MonkeyPatchable.MsSqlQueryCom
59
59
  || (typeof insert === 'object' && core_1.Utils.isEmpty(insert));
60
60
  }
61
61
  _mergeOn(conflict) {
62
- let sql = 'on 1=1';
63
- if (Array.isArray(conflict)) {
64
- const conflictColumn = this.formatter.columnize(conflict[0]);
65
- sql = `on ${this.tableName}.${conflictColumn} = tsource.${conflictColumn}`;
62
+ if (!Array.isArray(conflict)) {
63
+ return 'on 1=1';
66
64
  }
67
- return sql;
65
+ const parts = [];
66
+ for (const col of conflict) {
67
+ const conflictColumn = this.formatter.columnize(col);
68
+ parts.push(`${this.tableName}.${conflictColumn} = tsource.${conflictColumn}`);
69
+ }
70
+ return `on ${parts.join(' and ')}`;
68
71
  }
69
72
  _insertWithMerge() {
70
73
  const { insert = [], onConflict, ignore, merge, returning, options = {} } = this.single;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.4.7-dev.18",
3
+ "version": "6.4.7-dev.19",
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,7 +66,7 @@
66
66
  "@mikro-orm/core": "^6.4.6"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.4.7-dev.18",
69
+ "@mikro-orm/core": "6.4.7-dev.19",
70
70
  "better-sqlite3": "*",
71
71
  "libsql": "*",
72
72
  "mariadb": "*"