@mikro-orm/knex 6.5.4-dev.5 → 6.5.4

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.5.4-dev.5",
3
+ "version": "6.5.4",
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",
@@ -63,10 +63,10 @@
63
63
  "sqlstring": "2.3.3"
64
64
  },
65
65
  "devDependencies": {
66
- "@mikro-orm/core": "^6.5.3"
66
+ "@mikro-orm/core": "^6.5.4"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.5.4-dev.5",
69
+ "@mikro-orm/core": "^6.0.0",
70
70
  "better-sqlite3": "*",
71
71
  "libsql": "*",
72
72
  "mariadb": "*"
@@ -221,9 +221,10 @@ class ObjectCriteriaNode extends CriteriaNode_1.CriteriaNode {
221
221
  // - if the owning column is null, the row is missing, we don't apply the filter
222
222
  // - if the target column is not null, the row is matched, we apply the filter
223
223
  if (toOneProperty && this.prop.nullable && options?.filter) {
224
+ const key = this.prop.owner ? this.prop.name : this.prop.referencedPKs;
224
225
  qb.andWhere({
225
226
  $or: [
226
- { [field]: null },
227
+ { [alias + '.' + key]: null },
227
228
  { [nestedAlias + '.' + core_1.Utils.getPrimaryKeyHash(this.prop.referencedPKs)]: { $ne: null } },
228
229
  ],
229
230
  });