@mikro-orm/core 6.4.17-dev.10 → 6.4.17-dev.11

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.
@@ -1058,7 +1058,7 @@ class MetadataDiscovery {
1058
1058
  prop.defaultRaw = this.platform.formatQuery(raw.sql, raw.params);
1059
1059
  return;
1060
1060
  }
1061
- if (prop.customType instanceof types_1.ArrayType && Array.isArray(prop.default)) {
1061
+ if (Array.isArray(prop.default) && prop.customType) {
1062
1062
  val = prop.customType.convertToDatabaseValue(prop.default, this.platform);
1063
1063
  }
1064
1064
  prop.defaultRaw = typeof val === 'string' ? `'${val}'` : '' + val;
@@ -1112,6 +1112,9 @@ class MetadataDiscovery {
1112
1112
  if (prop.kind === enums_1.ReferenceKind.SCALAR && !prop.customType && prop.columnTypes && ['json', 'jsonb'].includes(prop.columnTypes[0])) {
1113
1113
  prop.customType = new types_1.JsonType();
1114
1114
  }
1115
+ if (prop.kind === enums_1.ReferenceKind.EMBEDDED && !prop.customType && (prop.object || prop.array)) {
1116
+ prop.customType = new types_1.JsonType();
1117
+ }
1115
1118
  if (!prop.customType && prop.array && prop.items) {
1116
1119
  prop.customType = new types_1.EnumArrayType(`${meta.className}.${prop.name}`, prop.items);
1117
1120
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "6.4.17-dev.10",
3
+ "version": "6.4.17-dev.11",
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",
@@ -64,7 +64,7 @@
64
64
  "esprima": "4.0.1",
65
65
  "fs-extra": "11.3.0",
66
66
  "globby": "11.1.0",
67
- "mikro-orm": "6.4.17-dev.10",
67
+ "mikro-orm": "6.4.17-dev.11",
68
68
  "reflect-metadata": "0.2.2"
69
69
  }
70
70
  }
@@ -121,7 +121,7 @@ class QueryHelper {
121
121
  value = QueryHelper.processCustomType(prop, value, platform, undefined, true);
122
122
  }
123
123
  const isJsonProperty = prop?.customType instanceof JsonType_1.JsonType && Utils_1.Utils.isPlainObject(value) && !platform.isRaw(value) && Object.keys(value)[0] !== '$eq';
124
- if (isJsonProperty) {
124
+ if (isJsonProperty && prop?.kind !== enums_1.ReferenceKind.EMBEDDED) {
125
125
  return this.processJsonCondition(o, value, [prop.fieldNames[0]], platform, aliased);
126
126
  }
127
127
  if (Array.isArray(value) && !Utils_1.Utils.isOperator(key) && !QueryHelper.isSupportedOperator(key) && !key.includes('?') && options.type !== 'orderBy') {