@mikro-orm/sql 7.2.9-dev.25 → 7.2.9-dev.26

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.9-dev.25",
3
+ "version": "7.2.9-dev.26",
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.8"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.2.9-dev.25"
56
+ "@mikro-orm/core": "7.2.9-dev.26"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"
@@ -1262,7 +1262,6 @@ export class QueryBuilder {
1262
1262
  const entities = [];
1263
1263
  for (const row of res) {
1264
1264
  const entity = this.mapResult(row);
1265
- this.propagatePopulateHint(entity, this.#state.populate);
1266
1265
  entities.push(entity);
1267
1266
  if (limit != null && --limit === 0) {
1268
1267
  break;
@@ -1300,7 +1299,9 @@ export class QueryBuilder {
1300
1299
  * Executes the query, returning both array of results and total count query (without offset and limit).
1301
1300
  */
1302
1301
  async getResultAndCount() {
1303
- return [await this.clone().getResultList(), await this.clone().getCount()];
1302
+ // `getCount()` clones by itself, except when the type is not set yet
1303
+ const countQb = this.#state.type === undefined ? this.clone() : this;
1304
+ return [await this.clone().getResultList(), await countQb.getCount()];
1304
1305
  }
1305
1306
  as(aliasOrTargetEntity, alias) {
1306
1307
  const qb = this.getNativeQuery();