All thoughts and posts are my own, said by @rakibtg.
posted at Saturday, 27 May 2017

In on of my project I am using Sequelize and loving it. Most importantly, I use Laravel for most of my projects and a huge fan of Laravel Eloquent, and oh! Sequelize is a lot like Laravel Eloquent.

To get started with Sequelize you need to install its CLI and the sequelize itself. Installing the CLI will allow you to migrate, seed data. You will be also able to create model using CLI, which will automatically create a migration file for you.

Let's install Sequelize CLI

npm install -g sequelize-cli

Installing Sequelize

npm install --save sequelize mysql mysql2

Creating a Model

sequelize model:create --name User --attributes full_name:string,user_name:string,bio:text

While we create this model sequelize will also generate a migration file for us. In this case the migration file will be located at the migrations directory of your project.

Migrating Data

sequelize db:migrate

In the next post I would demonstrate using Sequelize with Express JS.