@mikro-orm/knex 6.4.17-dev.18 → 6.4.17-dev.19

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.
@@ -1311,16 +1311,19 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
1311
1311
  ret.push('*');
1312
1312
  }
1313
1313
  if (ret.length > 0 && !hasExplicitFields && addFormulas) {
1314
- meta.props
1315
- .filter(prop => prop.formula && !lazyProps.includes(prop))
1316
- .forEach(prop => {
1317
- const a = this.platform.quoteIdentifier(alias);
1318
- const aliased = this.platform.quoteIdentifier(prop.fieldNames[0]);
1319
- ret.push((0, core_1.raw)(`${prop.formula(a)} as ${aliased}`));
1320
- });
1321
- meta.props
1322
- .filter(prop => !prop.object && (prop.hasConvertToDatabaseValueSQL || prop.hasConvertToJSValueSQL))
1323
- .forEach(prop => ret.push(prop.name));
1314
+ for (const prop of meta.props) {
1315
+ if (lazyProps.includes(prop)) {
1316
+ continue;
1317
+ }
1318
+ if (prop.formula) {
1319
+ const a = this.platform.quoteIdentifier(alias);
1320
+ const aliased = this.platform.quoteIdentifier(prop.fieldNames[0]);
1321
+ ret.push((0, core_1.raw)(`${prop.formula(a)} as ${aliased}`));
1322
+ }
1323
+ if (!prop.object && (prop.hasConvertToDatabaseValueSQL || prop.hasConvertToJSValueSQL)) {
1324
+ ret.push(prop.name);
1325
+ }
1326
+ }
1324
1327
  }
1325
1328
  // add joined relations after the root entity fields
1326
1329
  if (joinedProps.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.4.17-dev.18",
3
+ "version": "6.4.17-dev.19",
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.4.16"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.4.17-dev.18",
69
+ "@mikro-orm/core": "6.4.17-dev.19",
70
70
  "better-sqlite3": "*",
71
71
  "libsql": "*",
72
72
  "mariadb": "*"