@mikro-orm/knex 5.9.1-dev.4 → 5.9.2-dev.0

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.
@@ -100,12 +100,14 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
100
100
  }
101
101
  async wrapVirtualExpressionInSubquery(meta, expression, where, options, type) {
102
102
  const qb = this.createQueryBuilder(meta.className, options?.ctx, options.connectionType, options.convertCustomTypes)
103
- .limit(options?.limit, options?.offset)
104
103
  .indexHint(options.indexHint)
105
104
  .comment(options.comments)
106
105
  .hintComment(options.hintComments);
107
- if (options.orderBy) {
108
- qb.orderBy(options.orderBy);
106
+ if (type !== query_1.QueryType.COUNT) {
107
+ qb.limit(options?.limit, options?.offset);
108
+ if (options.orderBy) {
109
+ qb.orderBy(options.orderBy);
110
+ }
109
111
  }
110
112
  qb.where(where);
111
113
  const kqb = qb.getKnexQuery().clear('select');
@@ -576,7 +578,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
576
578
  joinedProps(meta, populate) {
577
579
  return populate.filter(p => {
578
580
  const prop = meta.properties[p.field] || {};
579
- return (p.strategy || prop.strategy || this.config.get('loadStrategy')) === core_1.LoadStrategy.JOINED && prop.reference !== core_1.ReferenceType.SCALAR;
581
+ return (p.strategy || prop.strategy || this.config.get('loadStrategy')) === core_1.LoadStrategy.JOINED && prop.reference !== core_1.ReferenceType.SCALAR && prop.reference !== core_1.ReferenceType.EMBEDDED;
580
582
  });
581
583
  }
582
584
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "5.9.1-dev.4",
3
+ "version": "5.9.2-dev.0",
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,12 +63,12 @@
63
63
  "sqlstring": "2.3.3"
64
64
  },
65
65
  "devDependencies": {
66
- "@mikro-orm/core": "^5.9.0"
66
+ "@mikro-orm/core": "^5.9.1"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "5.9.1-dev.4",
70
- "@mikro-orm/entity-generator": "5.9.1-dev.4",
71
- "@mikro-orm/migrations": "5.9.1-dev.4",
69
+ "@mikro-orm/core": "5.9.2-dev.0",
70
+ "@mikro-orm/entity-generator": "5.9.2-dev.0",
71
+ "@mikro-orm/migrations": "5.9.2-dev.0",
72
72
  "better-sqlite3": "*",
73
73
  "mssql": "*",
74
74
  "mysql": "*",