Why does TypeORM need reflect-metadata?
Asked Answered
U

1

10

I'm currently learning TypeScript with Node. Reading about TypeORM, I saw that the reflect-metadata package is needed for TypeORM to work. What is the reason for this package being needed?

Ute answered 2/4, 2018 at 20:59 Comment(2)
Why do you think it isn't? Please offer some reasoning as to why you think it wouldn't be so that we can help you understand the utility of the package.Reta
Well, you say to the orm what are the entities he must map. So i don't understand why the orm needs additional data (i came from jpa because that i don't understant it)Ute
B
20

With the reflect-metadata package you can do runtime reflection on types. Since TypeORM mostly works with decorators (like @Entity or @Column), this package is used to parse these decorators and use it for building sql queries.

The following link provides detailed information about what this package is capable of: http://blog.wolksoftware.com/decorators-metadata-reflection-in-typescript-from-novice-to-expert-part-4.

Buddybuderus answered 3/4, 2018 at 21:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.