Grokking ExpressJS
Vote

0% completed

​

Connecting Express to PostgreSQL with Sequelize

An object-relational mapper is a library that turns rows of a SQL table into JavaScript objects and turns changes to those objects back into SQL statements. The short name is ORM. With an ORM, you write Book.findByPk(1) and the library sends SELECT ... FROM "Books" AS "Book" WHERE "Book"."id" = 1 for you. The bookstore API from the previous two lessons now moves to PostgreSQL with the Sequelize ORM. Before any route can run, the app needs a database, a connection, a model that describes the books table, and the table itself, and this lesson sets up each of them in that order.

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content