@mikro-orm/sql 7.1.6-dev.4 → 7.1.6-dev.6

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.
@@ -2027,6 +2027,10 @@ export class AbstractSqlDriver extends DatabaseDriver {
2027
2027
  }
2028
2028
  const alias = '__p';
2029
2029
  const qb = this.createQueryBuilder(entityName, undefined, undefined, undefined, undefined, alias);
2030
+ // Select a constant instead of the default `*` — otherwise non-lazy `@Formula` properties
2031
+ // (and their embedded subqueries, which may contain their own `where`/cross-table refs)
2032
+ // leak into the SQL and corrupt the predicate extracted below. Only `from ... where` matters here.
2033
+ qb.select(raw('1'));
2030
2034
  qb.where(where);
2031
2035
  const sql = qb.getFormattedQuery();
2032
2036
  // Relation traversal produces join clauses whose aliased identifiers can't be inlined
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/sql",
3
- "version": "7.1.6-dev.4",
3
+ "version": "7.1.6-dev.6",
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.1.5"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.1.6-dev.4"
56
+ "@mikro-orm/core": "7.1.6-dev.6"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"