Sequelize: Model Definition Basics

Share this video with your friends

Send Tweet

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.

Norik Davtian
Norik Davtian
~ 9 years ago

Pro tip:

You can use [options.paranoid=true] instead of adding a visible field.. to show non-deleted rows.

Mike Frey
Mike Frey(instructor)
~ 9 years ago

The visible attribute is meant more as a "published" flag. In hindsight, I probably should have called it published.

Geoffrey
Geoffrey
~ 9 years ago

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.

Taeshik Hwang
Taeshik Hwang
~ 7 years ago

Unhandled rejection SequelizeConnectionError: database "mydb" does not exist

Do I need make postgredb for this lesson?(mydb)