@mikro-orm/knex 6.6.4-dev.3 → 6.6.4-dev.5

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.6.4-dev.3",
3
+ "version": "6.6.4-dev.5",
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.6.3"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.6.4-dev.3",
69
+ "@mikro-orm/core": "6.6.4-dev.5",
70
70
  "better-sqlite3": "*",
71
71
  "libsql": "*",
72
72
  "mariadb": "*"
@@ -256,8 +256,10 @@ class QueryBuilderHelper {
256
256
  processJoinClause(key, value, alias, params, operator = '$eq') {
257
257
  if (core_1.Utils.isGroupOperator(key) && Array.isArray(value)) {
258
258
  const parts = value.map(sub => {
259
- return this.wrapQueryGroup(Object.keys(sub).map(k => this.processJoinClause(k, sub[k], alias, params)));
260
- });
259
+ return this.wrapQueryGroup(Object.keys(sub).map(k => {
260
+ return this.processJoinClause(k, sub[k], alias, params);
261
+ }));
262
+ }).filter(clause => clause !== '()');
261
263
  return this.wrapQueryGroup(parts, key);
262
264
  }
263
265
  const rawField = core_1.RawQueryFragment.getKnownFragment(key);
@@ -319,6 +321,9 @@ class QueryBuilderHelper {
319
321
  return sql;
320
322
  }
321
323
  if (value !== null) {
324
+ if (core_1.Utils.isPlainObject(value)) {
325
+ return '()';
326
+ }
322
327
  if (prop?.customType) {
323
328
  value = prop.customType.convertToDatabaseValue(value, this.platform, { fromQuery: true, key, mode: 'query' });
324
329
  }