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
Today we used patch-package to patch @nestjs-query/query-typeorm@0.30.0 for the project we are working on. This patch made our codebase work with TypeORM 0.3.
Apparently, with TypeORM 0.3, this.repo.manager.getRepository(relationMeta.type).target return a string instead of the entity class in some cases.
// (1) in TodoEntity.ts
@ManyToOne(() => ProjectEntity)
project: ProjectEntity;
// (2) in ProjectEntity.ts
@OneToMany('TodoEntity', (todo) => todo.project
todos: TodoEntity[]
When specifying a typeFunction, repository.target equals the ProjectEntity class
鈿狅笍 When specifying a string, repository.target is the 'TodoEntity' string, not class
This behaviour was introduced in TypeORM 0.3 and breaks nestjs-query, while TypeORM 0.2 always returned the entity class (at least in our use cases).
TypeORM v3 support is now released in the alpha version of my fork together with all the fixes from here
Thanks TriPSs for keeping fixing the project bugs. The project owner should have transferred things over if he no longer continues to maintain this project, what a shame that it's a good project.
Hi! 馃憢
Firstly, thanks for your work on this project! 馃檪
Today we used patch-package to patch
@nestjs-query/query-typeorm@0.30.0
for the project we are working on. This patch made our codebase work with TypeORM 0.3.Apparently, with TypeORM 0.3,
this.repo.manager.getRepository(relationMeta.type).target
return astring
instead of the entityclass
in some cases.typeFunction
,repository.target
equals theProjectEntity
classstring
,repository.target
is the'TodoEntity'
string, not classThis behaviour was introduced in TypeORM 0.3 and breaks nestjs-query, while TypeORM 0.2 always returned the entity class (at least in our use cases).
Here is the diff that solved our problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: