@mikro-orm/knex 6.4.4-dev.1 → 6.4.4-dev.3

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.
@@ -382,7 +382,7 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
382
382
  sql += ' ' + data.map(() => `select null as ${this.platform.quoteIdentifier(pks[0])}`).join(' union all ');
383
383
  }
384
384
  const addParams = (prop, row) => {
385
- let value = row[prop.name];
385
+ let value = row[prop.name] ?? prop.default;
386
386
  if (prop.kind === core_1.ReferenceKind.EMBEDDED && prop.object) {
387
387
  if (prop.array && value) {
388
388
  value = this.platform.cloneEmbeddable(value);
@@ -399,6 +399,10 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
399
399
  params.push(prop.customType.convertToDatabaseValue(value, this.platform, { key: prop.name, mode: 'query-data' }));
400
400
  return;
401
401
  }
402
+ if (typeof value === 'undefined' && this.platform.usesDefaultKeyword()) {
403
+ params.push((0, core_1.raw)('default'));
404
+ return;
405
+ }
402
406
  params.push(value);
403
407
  };
404
408
  if (fields.length > 0 || this.platform.usesDefaultKeyword()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.4.4-dev.1",
3
+ "version": "6.4.4-dev.3",
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,7 +66,7 @@
66
66
  "@mikro-orm/core": "^6.4.3"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.4.4-dev.1",
69
+ "@mikro-orm/core": "6.4.4-dev.3",
70
70
  "better-sqlite3": "*",
71
71
  "libsql": "*",
72
72
  "mariadb": "*"