How to use Sequelize in Node.js ? Last Updated : 20 May, 2020 Comments Improve Suggest changes Like Article Like Report Sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite, and Microsoft SQL Server. Its features are solid transaction support, relations, eager and lazy loading, read replication and many more. Features of Sequelize: Sequelize is a third-party package to be precise its an Object-Relational Mapping Library(ORM).. Standardization ORMs usually have a single schema definition in the code. This makes it very clear what the schema is, and very simple to change it. No need to learn SQL - queries are written in plain JavaScript. Setting up a Node.js app: Start Node.js app using the following command: npm init -y Installation of Sequelize: Sequelize needs MySql module installed in your project. if you have not installed MySql module then make sure before installing Sequelize you need to install MySql2 module. You need to install this module by using the following command. npm install mysql2 After installing the MySql2 module, we have to install Sequelize module to install this module by using the following command. npm install sequelize Requiring module: You need to include Sequelize module in your project by using these lines. const Sequelize = require('sequelize'); Configuring database.js file: javascript // Include Sequelize module const Sequelize = require('sequelize') // Creating new Object of Sequelize const sequelize = new Sequelize( 'DATABASE_NAME', 'DATABASE_USER_NAME', 'DATABASE_PASSWORD', { // Explicitly specifying // mysql database dialect: 'mysql', // By default host is 'localhost' host: 'localhost' } ); // Exporting the sequelize object. // We can use it in another file // for creating models module.exports = sequelize Comment More infoAdvertise with us Next Article How to use Sequelize in Node.js ? K kartikmukati Follow Improve Article Tags : JavaScript Web Technologies Node.js Node.js-Misc Similar Reads How to update data in sqlite3 using Node.js ? In this article, we are going to see how to update data in the sqlite3 database using node.js. So for this, we are going to use the run function which is available in sqlite3. This function will help us to run the queries for updating the data.SQLite is a self-contained, high-reliability, embedded, 4 min read Node.js MySQL-Create Table Using Sequelize Introduction to Sequelize: Sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server. Its features are solid transaction support, relations, eager and lazy loading, read replication and many more. Connect to MySql Database using Sequelize:Â To establish c 3 min read How to Send JSON Response using Node.js ? NodeJS is the runtime environment, which can execute the javascript code on any platform. It is widely used to create and run web application servers because of its salient features.During production, several times we need to send the resources or some type of information as a response, and javascri 5 min read How to Create Table in SQLite3 Database using Node.js ? Creating a table in an SQLite database using Node.js involves several steps, including setting up a connection to the database, defining the table schema, and executing SQL commands to create the table. SQLite is a lightweight and serverless database that is widely used, especially in applications t 3 min read How to Connect SQLite3 Database using Node.js ? Connecting SQLite3 database with Node.js involves a few straightforward steps to set up and interact with the database. SQLite is a self-contained, serverless, zero-configuration, transactional SQL database engine, making it ideal for small to medium-sized applications. Hereâs how you can connect an 2 min read Like