@mikro-orm/knex 5.7.12-dev.0 → 5.7.12-dev.10

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.
@@ -115,7 +115,7 @@ class AbstractSqlConnection extends core_1.Connection {
115
115
  });
116
116
  }
117
117
  getKnexOptions(type) {
118
- const config = core_1.Utils.merge({
118
+ const config = core_1.Utils.mergeConfig({
119
119
  client: type,
120
120
  connection: this.getConnectionOptions(),
121
121
  pool: this.config.get('pool'),
@@ -177,5 +177,5 @@ class AbstractSqlConnection extends core_1.Connection {
177
177
  };
178
178
  }
179
179
  }
180
- AbstractSqlConnection.__patched = false;
181
180
  exports.AbstractSqlConnection = AbstractSqlConnection;
181
+ AbstractSqlConnection.__patched = false;
@@ -79,7 +79,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
79
79
  const em = this.createEntityManager(false);
80
80
  em.setTransactionContext(options.ctx);
81
81
  const res = meta.expression(em, where, options);
82
- if (res instanceof (query_1.QueryBuilder)) {
82
+ if (res instanceof query_1.QueryBuilder) {
83
83
  return this.wrapVirtualExpressionInSubquery(meta, res.getFormattedQuery(), where, options);
84
84
  }
85
85
  /* istanbul ignore next */
@@ -97,7 +97,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
97
97
  const em = this.createEntityManager(false);
98
98
  em.setTransactionContext(options.ctx);
99
99
  const res = meta.expression(em, where, options);
100
- if (res instanceof (query_1.QueryBuilder)) {
100
+ if (res instanceof query_1.QueryBuilder) {
101
101
  return this.wrapVirtualExpressionInSubquery(meta, res.getFormattedQuery(), where, options, query_1.QueryType.COUNT);
102
102
  }
103
103
  /* istanbul ignore next */
@@ -337,7 +337,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
337
337
  qb.insert(data)
338
338
  .onConflict(uniqueFields.map(p => meta?.properties[p]?.fieldNames[0] ?? p))
339
339
  .merge(Object.keys(data).filter(f => !uniqueFields.includes(f)))
340
- .returning(meta?.comparableProps.filter(p => !p.lazy && !(p.name in data)).map(p => p.name) ?? '*');
340
+ .returning(meta?.comparableProps.filter(p => !p.lazy && !p.embeddable && !(p.name in data)).map(p => p.name) ?? '*');
341
341
  }
342
342
  else {
343
343
  qb.update(data).where(where);
@@ -359,7 +359,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
359
359
  qb.insert(data)
360
360
  .onConflict(uniqueFields.map(p => meta.properties[p]?.fieldNames[0] ?? p))
361
361
  .merge(Object.keys(data[0]).filter(f => !uniqueFields.includes(f)))
362
- .returning(meta.comparableProps.filter(p => !p.lazy && !(p.name in data[0])).map(p => p.name) ?? '*');
362
+ .returning(meta.comparableProps.filter(p => !p.lazy && !p.embeddable && !(p.name in data[0])).map(p => p.name) ?? '*');
363
363
  return qb.execute('run', false);
364
364
  }
365
365
  const collections = options.processCollections ? data.map(d => this.extractManyToMany(entityName, d)) : [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "5.7.12-dev.0",
3
+ "version": "5.7.12-dev.10",
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,9 +66,9 @@
66
66
  "@mikro-orm/core": "^5.7.11"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "~5.7.12-dev.0",
70
- "@mikro-orm/entity-generator": "~5.7.12-dev.0",
71
- "@mikro-orm/migrations": "~5.7.12-dev.0",
69
+ "@mikro-orm/core": "~5.7.12-dev.10",
70
+ "@mikro-orm/entity-generator": "~5.7.12-dev.10",
71
+ "@mikro-orm/migrations": "~5.7.12-dev.10",
72
72
  "better-sqlite3": "*",
73
73
  "mssql": "*",
74
74
  "mysql": "*",
package/query/enums.js CHANGED
@@ -9,4 +9,4 @@ var QueryType;
9
9
  QueryType["INSERT"] = "INSERT";
10
10
  QueryType["UPDATE"] = "UPDATE";
11
11
  QueryType["DELETE"] = "DELETE";
12
- })(QueryType = exports.QueryType || (exports.QueryType = {}));
12
+ })(QueryType || (exports.QueryType = QueryType = {}));