@mikro-orm/knex 6.0.0-dev.37 → 6.0.0-dev.39

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.
@@ -273,7 +273,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
273
273
  props.forEach(prop => {
274
274
  if (prop.fieldNames.length > 1) {
275
275
  params.push(...(row[prop.name] ?? prop.fieldNames.map(() => null)));
276
- keys.push(...prop.fieldNames.map(_ => '?'));
276
+ keys.push(...(row[prop.name] ?? prop.fieldNames).map(() => '?'));
277
277
  }
278
278
  else if (prop.customType && 'convertToDatabaseValueSQL' in prop.customType && !this.platform.isRaw(row[prop.name])) {
279
279
  keys.push(prop.customType.convertToDatabaseValueSQL('?', this.platform));
package/index.mjs CHANGED
@@ -34,6 +34,7 @@ export const ConfigurationLoader = mod.ConfigurationLoader;
34
34
  export const Connection = mod.Connection;
35
35
  export const ConnectionException = mod.ConnectionException;
36
36
  export const ConstraintViolationException = mod.ConstraintViolationException;
37
+ export const CreateRequestContext = mod.CreateRequestContext;
37
38
  export const CriteriaNode = mod.CriteriaNode;
38
39
  export const CriteriaNodeFactory = mod.CriteriaNodeFactory;
39
40
  export const Cursor = mod.Cursor;
@@ -51,6 +52,7 @@ export const DoubleType = mod.DoubleType;
51
52
  export const DriverException = mod.DriverException;
52
53
  export const Embeddable = mod.Embeddable;
53
54
  export const Embedded = mod.Embedded;
55
+ export const EnsureRequestContext = mod.EnsureRequestContext;
54
56
  export const Entity = mod.Entity;
55
57
  export const EntityAssigner = mod.EntityAssigner;
56
58
  export const EntityCaseNamingStrategy = mod.EntityCaseNamingStrategy;
@@ -169,7 +171,6 @@ export const Unique = mod.Unique;
169
171
  export const UniqueConstraintViolationException = mod.UniqueConstraintViolationException;
170
172
  export const UnitOfWork = mod.UnitOfWork;
171
173
  export const UnknownType = mod.UnknownType;
172
- export const UseRequestContext = mod.UseRequestContext;
173
174
  export const Utils = mod.Utils;
174
175
  export const UuidType = mod.UuidType;
175
176
  export const ValidationError = mod.ValidationError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.0.0-dev.37",
3
+ "version": "6.0.0-dev.39",
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.6.9"
66
+ "@mikro-orm/core": "^5.6.10"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "~6.0.0-dev.37"
69
+ "@mikro-orm/core": "~6.0.0-dev.39"
70
70
  }
71
71
  }
@@ -701,7 +701,6 @@ class QueryBuilder {
701
701
  }
702
702
  if (data) {
703
703
  if (core_1.Utils.isEntity(data)) {
704
- // data = helper(data).toJSON();
705
704
  data = this.em?.getComparator().prepareEntity(data) ?? (0, core_1.serialize)(data);
706
705
  }
707
706
  this._data = this.helper.processData(data, this.flags.has(core_1.QueryFlag.CONVERT_CUSTOM_TYPES));
@@ -609,7 +609,7 @@ class QueryBuilderHelper {
609
609
  return;
610
610
  }
611
611
  if (prop.joinColumns && Array.isArray(data[k])) {
612
- const copy = data[k];
612
+ const copy = core_1.Utils.flatten(data[k]);
613
613
  delete data[k];
614
614
  prop.joinColumns.forEach((joinColumn, idx) => data[joinColumn] = copy[idx]);
615
615
  return;