How to use Sequelize with Shopify template Node?

I created app by Shopify tutorial Template Nodejs and Mysql. I want to use Sequelize npm instead of querying mysql. How can I use Sequelize? Thank you very much.

This is my structure:

Hi,

You need to install sequelize

npm i sequelize

Sequelize is a promise-based node.js ORM tool for mysql, postgres, ms-sql, oracle database.

1 Like

Hi @oscprofessional ,

Thank you for your help, but I have problem with Sequelize and ES6 about using ‘import’ instead of ‘require’. What can I fix it?

Hi @AndyHung ,

For relational database with a Node application, Sequelize is easy-to-use multi SQL dialect ORM for Node.js

It allows application to run backend by MySql or Postgres.

To initialise model using ES6 classes or associate your model or setting custom table

you can use,

const Sequelize = require("sequelize");

You should not use sequelize.import

It is deprecated