@mikro-orm/knex 6.3.14-dev.58 → 6.3.14-dev.59

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.3.14-dev.58",
3
+ "version": "6.3.14-dev.59",
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.3.13"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.3.14-dev.58",
69
+ "@mikro-orm/core": "6.3.14-dev.59",
70
70
  "better-sqlite3": "*",
71
71
  "libsql": "*",
72
72
  "mariadb": "*"
@@ -471,13 +471,14 @@ class QueryBuilderHelper {
471
471
  if (fields.length > 1 && Array.isArray(value[op])) {
472
472
  const singleTuple = !value[op].every((v) => Array.isArray(v));
473
473
  if (!this.platform.allowsComparingTuples()) {
474
+ const mapped = fields.map(f => this.mapper(f, type));
474
475
  if (op === '$in') {
475
476
  const conds = value[op].map(() => {
476
- return `(${fields.map(field => `${this.platform.quoteIdentifier(field)} = ?`).join(' and ')})`;
477
+ return `(${mapped.map(field => `${this.platform.quoteIdentifier(field)} = ?`).join(' and ')})`;
477
478
  });
478
479
  return void qb[m](this.knex.raw(`(${conds.join(' or ')})`, core_1.Utils.flatten(value[op])));
479
480
  }
480
- return void qb[m](this.knex.raw(`${fields.map(field => `${this.platform.quoteIdentifier(field)} = ?`).join(' and ')}`, core_1.Utils.flatten(value[op])));
481
+ return void qb[m](this.knex.raw(`${mapped.map(field => `${this.platform.quoteIdentifier(field)} = ?`).join(' and ')}`, core_1.Utils.flatten(value[op])));
481
482
  }
482
483
  if (singleTuple) {
483
484
  const tmp = value[op].length === 1 && core_1.Utils.isPlainObject(value[op][0]) ? fields.map(f => value[op][0][f]) : value[op];