Sequelize is an Object Relational Mapper (ORM), which simplifies interacting with relational databases by abstracting away the need to use SQL directly. This lesson introduces defining models with Sequelize in Node.js.
You will need the Postgres database for this lesson! For Mac users, postgressapp makes this easy.
Pro tip:
You can use [options.paranoid=true] instead of adding a visible field.. to show non-deleted rows.
The visible attribute is meant more as a "published" flag. In hindsight, I probably should have called it published
.
I would recommend using a different model name the posts. Most people naturally associate post with the http verb and it could be confusing. Pet store models are usually easiest.
Unhandled rejection SequelizeConnectionError: database "mydb" does not exist
Do I need make postgredb for this lesson?(mydb)