@mikro-orm/core 6.4.1-dev.19 → 6.4.1-dev.20
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/entity/EntityAssigner.d.ts +49 -0
- package/package.json +2 -2
|
@@ -17,14 +17,63 @@ export declare class EntityAssigner {
|
|
|
17
17
|
}
|
|
18
18
|
export declare const assign: typeof EntityAssigner.assign;
|
|
19
19
|
export interface AssignOptions<Convert extends boolean> {
|
|
20
|
+
/**
|
|
21
|
+
* Allows disabling processing of nested relations. When disabled, an object payload in place of a relation always
|
|
22
|
+
* results in an `INSERT` query. To assign a value of the relation, use the foreign key instead of an object.
|
|
23
|
+
* Defaults to `true`.
|
|
24
|
+
*/
|
|
20
25
|
updateNestedEntities?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* When assigning to a relation property with object payload and `updateNestedEntities` enabled (default), you can
|
|
28
|
+
* control how a payload without a primary key is handled. By default, it is considered as a new object, resulting
|
|
29
|
+
* in an `INSERT` query. Use `updateByPrimaryKey: false` to allow assigning the data on an existing relation instead.
|
|
30
|
+
* Defaults to `true`.
|
|
31
|
+
*/
|
|
21
32
|
updateByPrimaryKey?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* When you have some properties in the payload that are not represented by an entity property mapping, you can skip
|
|
35
|
+
* such unknown properties via `onlyProperties: true`. Defaults to `false`.
|
|
36
|
+
*/
|
|
22
37
|
onlyProperties?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* With `onlyOwnProperties` enabled, to-many relations are skipped, and payloads of to-one relations are converted
|
|
40
|
+
* to foreign keys. Defaults to `false`.
|
|
41
|
+
*/
|
|
23
42
|
onlyOwnProperties?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* `assign` excepts runtime values for properties using custom types. To be able to assign raw database values, you
|
|
45
|
+
* can enable the `convertCustomTypes` option. Defaults to `false`.
|
|
46
|
+
*/
|
|
24
47
|
convertCustomTypes?: Convert;
|
|
48
|
+
/**
|
|
49
|
+
* When assigning to a JSON property, the value is replaced. Use `mergeObjectProperties: true` to enable deep merging
|
|
50
|
+
* of the payload with the existing value. Defaults to `false`.
|
|
51
|
+
*/
|
|
25
52
|
mergeObjectProperties?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* When assigning to an embedded property, the values are deeply merged with the existing data.
|
|
55
|
+
* Use `mergeEmbeddedProperties: false` to replace them instead. Defaults to `true`.
|
|
56
|
+
*/
|
|
26
57
|
mergeEmbeddedProperties?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* When assigning to a relation property, if the value is a POJO and `updateByPrimaryKey` is enabled, we check if
|
|
60
|
+
* the target exists in the identity map based on its primary key and call `assign` on it recursively. If there is
|
|
61
|
+
* no primary key provided, or the entity is not present in the context, such an entity is considered as new
|
|
62
|
+
* (resulting in `INSERT` query), created via `em.create()`. You can use `merge: true` to use `em.merge()` instead,
|
|
63
|
+
* which means there won't be any query used for persisting the relation. Defaults to `false`.
|
|
64
|
+
*/
|
|
27
65
|
merge?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* When assigning to a to-many relation properties (`Collection`) with `updateNestedEntities` and `updateByPrimaryKey`
|
|
68
|
+
* enabled (default), you can use this option to override the relation schema. This is used only when trying to find
|
|
69
|
+
* the entity reference in the current context. If it is not found, we create the relation entity using the target
|
|
70
|
+
* entity schema. The value is automatically inferred from the target entity.
|
|
71
|
+
*/
|
|
28
72
|
schema?: string;
|
|
73
|
+
/**
|
|
74
|
+
* When using the static `assign()` helper, you can pass the EntityManager instance explicitly via the `em` option.
|
|
75
|
+
* This is only needed when you try to assign a relation property. The value is automatically inferred from the target
|
|
76
|
+
* entity when it is managed, or when you use `em.assign()` instead.
|
|
77
|
+
*/
|
|
29
78
|
em?: EntityManager;
|
|
30
79
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
|
-
"version": "6.4.1-dev.
|
|
3
|
+
"version": "6.4.1-dev.20",
|
|
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",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"esprima": "4.0.1",
|
|
65
65
|
"fs-extra": "11.2.0",
|
|
66
66
|
"globby": "11.1.0",
|
|
67
|
-
"mikro-orm": "6.4.1-dev.
|
|
67
|
+
"mikro-orm": "6.4.1-dev.20",
|
|
68
68
|
"reflect-metadata": "0.2.2"
|
|
69
69
|
}
|
|
70
70
|
}
|