@mikro-orm/core 7.0.11-dev.11 → 7.0.11-dev.13
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.
- package/metadata/MetadataDiscovery.js +4 -1
- package/package.json +1 -1
- package/utils/Utils.js +1 -1
|
@@ -1592,7 +1592,10 @@ export class MetadataDiscovery {
|
|
|
1592
1592
|
prop.defaultRaw = this.#platform.formatQuery(raw.sql, raw.params);
|
|
1593
1593
|
return;
|
|
1594
1594
|
}
|
|
1595
|
-
|
|
1595
|
+
// TODO(v8): always convert the default via the custom type — the `compareAsType() !== 'any'`
|
|
1596
|
+
// guard preserves the legacy convention where JSON defaults are passed pre-stringified.
|
|
1597
|
+
// Array defaults are converted unconditionally (e.g. `default: []` on a JSON-backed embedded array).
|
|
1598
|
+
if (prop.customType && (Array.isArray(prop.default) || prop.customType.compareAsType() !== 'any')) {
|
|
1596
1599
|
val = prop.customType.convertToDatabaseValue(prop.default, this.#platform);
|
|
1597
1600
|
}
|
|
1598
1601
|
prop.defaultRaw = typeof val === 'string' ? `'${val}'` : '' + val;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
|
-
"version": "7.0.11-dev.
|
|
3
|
+
"version": "7.0.11-dev.13",
|
|
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",
|
package/utils/Utils.js
CHANGED
|
@@ -141,7 +141,7 @@ export function parseJsonSafe(value) {
|
|
|
141
141
|
/** Collection of general-purpose utility methods used throughout the ORM. */
|
|
142
142
|
export class Utils {
|
|
143
143
|
static PK_SEPARATOR = '~~~';
|
|
144
|
-
static #ORM_VERSION = '7.0.11-dev.
|
|
144
|
+
static #ORM_VERSION = '7.0.11-dev.13';
|
|
145
145
|
/**
|
|
146
146
|
* Checks if the argument is instance of `Object`. Returns false for arrays.
|
|
147
147
|
*/
|