O'Reilly logo

Nest.js: A Progressive Node.js Framework by David Guijarro, Adrien de Peretti, Patrick Housley, Greg Magolan, Jay Bell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Sequelize

Sequelize is a promise-based ORM working for Node.js v4 and later. This ORM supports many dialects, such as:

  • PostgreSQL
  • MySQL
  • SQLite
  • MSSQL

This provides a solid support for transactions. With Sequelize you have the possibility of using sequelize-typescript, which provides decorators to put in your entity and manages all the fields of your model, with types and constraints.

Also, Sequelize comes from many hooks providing you with the significant advantage of being able to check and manipulate your data at any level of the transaction.

In this chapter, we will see how to configure your database using postgresql and how to configure the connection to your database. After that we will see how to implement our first entity, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required