@mikro-orm/knex 6.0.0-dev.85 → 6.0.0-dev.86

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.
@@ -123,7 +123,7 @@ class AbstractSqlConnection extends core_1.Connection {
123
123
  });
124
124
  }
125
125
  getKnexOptions(type) {
126
- const config = core_1.Utils.merge({
126
+ const config = core_1.Utils.mergeConfig({
127
127
  client: type,
128
128
  connection: this.getConnectionOptions(),
129
129
  pool: this.config.get('pool'),
@@ -185,5 +185,5 @@ class AbstractSqlConnection extends core_1.Connection {
185
185
  };
186
186
  }
187
187
  }
188
- AbstractSqlConnection.__patched = false;
189
188
  exports.AbstractSqlConnection = AbstractSqlConnection;
189
+ AbstractSqlConnection.__patched = false;
@@ -91,7 +91,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
91
91
  const em = this.createEntityManager(false);
92
92
  em.setTransactionContext(options.ctx);
93
93
  const res = meta.expression(em, where, options);
94
- if (res instanceof (query_1.QueryBuilder)) {
94
+ if (res instanceof query_1.QueryBuilder) {
95
95
  return this.wrapVirtualExpressionInSubquery(meta, res.getFormattedQuery(), where, options);
96
96
  }
97
97
  /* istanbul ignore next */
@@ -109,7 +109,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
109
109
  const em = this.createEntityManager(false);
110
110
  em.setTransactionContext(options.ctx);
111
111
  const res = meta.expression(em, where, options);
112
- if (res instanceof (query_1.QueryBuilder)) {
112
+ if (res instanceof query_1.QueryBuilder) {
113
113
  return this.wrapVirtualExpressionInSubquery(meta, res.getFormattedQuery(), where, options, query_1.QueryType.COUNT);
114
114
  }
115
115
  /* istanbul ignore next */
@@ -357,7 +357,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
357
357
  qb.insert(data)
358
358
  .onConflict(uniqueFields.map(p => meta?.properties[p]?.fieldNames[0] ?? p))
359
359
  .merge(core_1.Utils.keys(data).filter(f => !uniqueFields.includes(f)))
360
- .returning(meta?.comparableProps.filter(p => !p.lazy && !(p.name in data)).map(p => p.name) ?? '*');
360
+ .returning(meta?.comparableProps.filter(p => !p.lazy && !p.embeddable && !(p.name in data)).map(p => p.name) ?? '*');
361
361
  }
362
362
  else {
363
363
  qb.update(data).where(where);
@@ -379,7 +379,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
379
379
  qb.insert(data)
380
380
  .onConflict(uniqueFields.map(p => meta.properties[p]?.fieldNames[0] ?? p))
381
381
  .merge(Object.keys(data[0]).filter(f => !uniqueFields.includes(f)))
382
- .returning(meta.comparableProps.filter(p => !p.lazy && !(p.name in data[0])).map(p => p.name) ?? '*');
382
+ .returning(meta.comparableProps.filter(p => !p.lazy && !p.embeddable && !(p.name in data[0])).map(p => p.name) ?? '*');
383
383
  return qb.execute('run', false);
384
384
  }
385
385
  const collections = options.processCollections ? data.map(d => this.extractManyToMany(entityName, d)) : [];
package/index.mjs CHANGED
@@ -175,6 +175,7 @@ export const TinyIntType = mod.TinyIntType;
175
175
  export const TransactionContext = mod.TransactionContext;
176
176
  export const TransactionEventBroadcaster = mod.TransactionEventBroadcaster;
177
177
  export const Type = mod.Type;
178
+ export const Uint8ArrayType = mod.Uint8ArrayType;
178
179
  export const UnderscoreNamingStrategy = mod.UnderscoreNamingStrategy;
179
180
  export const Unique = mod.Unique;
180
181
  export const UniqueConstraintViolationException = mod.UniqueConstraintViolationException;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.0.0-dev.85",
3
+ "version": "6.0.0-dev.86",
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,9 +63,9 @@
63
63
  "sqlstring": "2.3.3"
64
64
  },
65
65
  "devDependencies": {
66
- "@mikro-orm/core": "^5.7.10"
66
+ "@mikro-orm/core": "^5.7.12"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "~6.0.0-dev.85"
69
+ "@mikro-orm/core": "~6.0.0-dev.86"
70
70
  }
71
71
  }
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 = {}));