@mikro-orm/sql 7.2.2-dev.10 → 7.2.2-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/sql",
3
- "version": "7.2.2-dev.10",
3
+ "version": "7.2.2-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
  "keywords": [
6
6
  "data-mapper",
@@ -53,7 +53,7 @@
53
53
  "@mikro-orm/core": "^7.2.1"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.2.2-dev.10"
56
+ "@mikro-orm/core": "7.2.2-dev.11"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"
@@ -2322,7 +2322,10 @@ export class QueryBuilder {
2322
2322
  const fieldName = this.helper.mapper(field, this.type, undefined, null);
2323
2323
  // virtual fields (e.g. `qb.as(...)`) have no column to reference inside `min()`; inline their
2324
2324
  // expression instead, as a select alias is not resolvable there on some dialects (e.g. PostgreSQL)
2325
- const virtual = !prop?.persist && !prop?.formula && !prop?.hasConvertToJSValueSQL && !pks.includes(fieldName)
2325
+ const virtual = (!prop || prop.persist === false) &&
2326
+ !prop?.formula &&
2327
+ !prop?.hasConvertToJSValueSQL &&
2328
+ !pks.includes(fieldName)
2326
2329
  ? this.resolveVirtualField(f, fieldName)
2327
2330
  : undefined;
2328
2331
  const expr = virtual ? virtual.expr : this.platform.quoteIdentifier(fieldName);