Chapter 5. TypeORM
Almost every time you use Nest.js in the real world, you need some kind of persistence for your data. That is, you need to save the data that the Nest.js app receives somewhere, and you need to read data from somewhere so that you can then pass that data as a response to the requests that the Nest.js app receives.
That “somewhere” will be, most of the time, a database.
TypeORM is a Object Relational Mapping (ORM) that works with several different relational databases. An Object Relational Mapping is a tool that converts between objects (such as “Entry” or “Comment,” since we’re building a blog) and tables in a database.
The result of this conversion is an entity (called Data Transfer Object) that knows how to read data from the database to memory (so you can use the data as a response for a request,) as well as how to write to the database from memory (so that you are able to store data for later).
TypeORM is conceptually...