You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(typeorm): upgrade typeorm to v0.3 and address breaking changes
typeorm intorduced several breaking changes in v0.3.0. this refactors the library to account for
those changes. specifically some changes to the repository interface and the removal of the ability
to fetch a custom repository.
BREAKING CHANGE: `EntityRepository` is replaced with `PolymorphicRepository`.
`connection.getCustomRepository` is replaced with `AbstractPolymorphicRepository.createRepository`.
dataSource, // where `dataSource` is a typeorm DataSource object
41
+
AdvertRepository,
42
+
);
43
+
```
44
+
32
45
> The below decorators will only work when using the above abstract repository AbstractPolymorphicRepository
33
46
34
47
### Setup the entities
@@ -96,6 +109,9 @@ id | entityId | entityType
96
109
97
110
Both `PolymorphicChildren` and `PolymophicParent` are treated same. Currently some of the default values are different but eventually these method should be synonyms of one another. They have different names because it helped me describe the relationship directions which could be explained as 'parent' 'child' in different ways.
98
111
112
+
`PolymophicRepository` allows you to define a custom typeorm repository and then
113
+
instantiate it later via `AbstractPolymorphicRepository.createRepository(...)`.
114
+
99
115
### Ambiguous direction
100
116
101
117
Both `PolymorphicParent` and `PolymorphicChildren` accepts either an array of types or a singular type
0 commit comments