@mikro-orm/knex 6.3.8 → 6.3.9-dev.1

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.8",
3
+ "version": "6.3.9-dev.1",
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.8"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "^6.0.0",
69
+ "@mikro-orm/core": "6.3.9-dev.1",
70
70
  "better-sqlite3": "*",
71
71
  "libsql": "*",
72
72
  "mariadb": "*"
@@ -963,29 +963,24 @@ class QueryBuilder {
963
963
  if (prop?.persist === false && !prop.embedded && !prop.formula && type === 'where') {
964
964
  return;
965
965
  }
966
- if (prop?.embedded) {
966
+ if (prop?.embedded || (prop?.kind === core_1.ReferenceKind.EMBEDDED && prop.object)) {
967
967
  const name = prop.embeddedPath?.join('.') ?? prop.fieldNames[0];
968
968
  const aliased = this._aliases[a] ? `${a}.${name}` : name;
969
969
  ret.push(getFieldName(aliased));
970
970
  return;
971
971
  }
972
972
  if (prop?.kind === core_1.ReferenceKind.EMBEDDED) {
973
- if (prop.object) {
974
- ret.push(getFieldName(prop.fieldNames[0]));
975
- }
976
- else {
977
- const nest = (prop) => {
978
- for (const childProp of Object.values(prop.embeddedProps)) {
979
- if (childProp.fieldNames && (childProp.kind !== core_1.ReferenceKind.EMBEDDED || childProp.object) && childProp.persist !== false) {
980
- ret.push(getFieldName(childProp.fieldNames[0]));
981
- }
982
- else {
983
- nest(childProp);
984
- }
973
+ const nest = (prop) => {
974
+ for (const childProp of Object.values(prop.embeddedProps)) {
975
+ if (childProp.fieldNames && (childProp.kind !== core_1.ReferenceKind.EMBEDDED || childProp.object) && childProp.persist !== false) {
976
+ ret.push(getFieldName(childProp.fieldNames[0]));
985
977
  }
986
- };
987
- nest(prop);
988
- }
978
+ else {
979
+ nest(childProp);
980
+ }
981
+ }
982
+ };
983
+ nest(prop);
989
984
  return;
990
985
  }
991
986
  if (prop && prop.fieldNames.length > 1) {