@mikro-orm/sql 7.2.10-dev.18 → 7.2.10-dev.19

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.
@@ -1,4 +1,4 @@
1
- import { ALIAS_REPLACEMENT_RE, DatabaseDriver, EntityManagerType, getLoadingStrategy, getOnConflictFields, getOnConflictReturningFields, helper, isRaw, LoadStrategy, parseJsonSafe, PolymorphicRef, QueryFlag, QueryHelper, QueryOrder, raw, RawQueryFragment, ReferenceKind, Utils, } from '@mikro-orm/core';
1
+ import { ALIAS_REPLACEMENT_RE, DatabaseDriver, DateType, EntityManagerType, getLoadingStrategy, getOnConflictFields, getOnConflictReturningFields, helper, isRaw, LoadStrategy, parseJsonSafe, PolymorphicRef, QueryFlag, QueryHelper, QueryOrder, raw, RawQueryFragment, ReferenceKind, Utils, } from '@mikro-orm/core';
2
2
  import { QueryBuilder } from './query/QueryBuilder.js';
3
3
  import { JoinType, QueryType } from './query/enums.js';
4
4
  import { SqlEntityManager } from './SqlEntityManager.js';
@@ -612,6 +612,11 @@ export class AbstractSqlDriver extends DatabaseDriver {
612
612
  relationPojo[prop.name] = value;
613
613
  }
614
614
  }
615
+ else if (prop.customType instanceof DateType) {
616
+ // tedious returns DATE columns as `Date`, map them to the string the entity holds, so the snapshot matches it
617
+ const value = row[keys[0]];
618
+ relationPojo[prop.name] = (value instanceof Date ? this.platform.convertDateToJSValue(value) : value);
619
+ }
615
620
  else {
616
621
  relationPojo[prop.name] = row[keys[0]];
617
622
  if (prop.kind === ReferenceKind.EMBEDDED && (prop.object || meta.embeddable)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/sql",
3
- "version": "7.2.10-dev.18",
3
+ "version": "7.2.10-dev.19",
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
  "keywords": [
6
6
  "data-mapper",
@@ -53,7 +53,7 @@
53
53
  "@mikro-orm/core": "^7.2.9"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.2.10-dev.18"
56
+ "@mikro-orm/core": "7.2.10-dev.19"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"