/
🟩

ORM

Table of contents

What is ORM?

Object Relational Mapping is technique that lets you query and manipulate data from a database, using an object oriented paradigm.

Pros of ORM

  • writing the data model in one place - easier to maintain.
  • lots of things done automatically
  • no need to write SQL syntax
  • database abstraction - you can change the database type whenever you wish.
  • leverages OOP therefore things like inheritance are easy to achieve.

Cons of ORM

  • you have to learn it, and ORM libraries are not always simple
  • performance is alright, but it's easy to neglect
  • makes it easy to forget (or never learn)

Install TypeORM

Terminal
npm i @nestjs/typeorm typeorm pg
logo
Hi Mohsen save your notes