Sequelize: Model Definition Basics

InstructorMike Frey

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.

Free Community Resource

A Community Resource means that it’s free to access for all. The instructor of this lesson requested it to be open to the public.

Norik Davtian
Norik Davtian
~ 6 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)
~ 6 years ago

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

Geoffrey
Geoffrey
~ 5 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
~ 4 years ago

Unhandled rejection SequelizeConnectionError: database "mydb" does not exist

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