@mikro-orm/knex 6.2.10-dev.50 → 6.2.10-dev.52

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.
@@ -538,7 +538,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
538
538
  let sql = `update ${this.getTableName(meta, options)} set `;
539
539
  const addParams = (prop, value) => {
540
540
  if (prop.kind === core_1.ReferenceKind.EMBEDDED && prop.object) {
541
- if (prop.array) {
541
+ if (prop.array && value) {
542
542
  for (let i = 0; i < value.length; i++) {
543
543
  const item = value[i];
544
544
  value[i] = this.mapDataToFieldNames(item, false, prop.embeddedProps, options.convertCustomTypes);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.2.10-dev.50",
3
+ "version": "6.2.10-dev.52",
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.2.9"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.2.10-dev.50",
69
+ "@mikro-orm/core": "6.2.10-dev.52",
70
70
  "better-sqlite3": "*",
71
71
  "libsql": "*",
72
72
  "mariadb": "*"
@@ -453,6 +453,9 @@ class QueryBuilderHelper {
453
453
  const tmp = value[op].length === 1 && core_1.Utils.isPlainObject(value[op][0]) ? fields.map(f => value[op][0][f]) : value[op];
454
454
  value[op] = this.knex.raw(`(${fields.map(() => '?').join(', ')})`, tmp);
455
455
  }
456
+ if (value[op] instanceof core_1.RawQueryFragment) {
457
+ value[op] = this.knex.raw(value[op].sql, value[op].params);
458
+ }
456
459
  if (this.subQueries[key]) {
457
460
  return void qb[m](this.knex.raw(`(${this.subQueries[key]})`), replacement, value[op]);
458
461
  }