Sequelize is a promise-based Node.js ORM tool for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server. It features solid transaction support, relations, eager and lazy loading, read replication and more.
Sequelize follows Semantic Versioning and supports Node v10 and above.
Would you like to contribute? Read our contribution guidelines to know more. There are many ways to help.
You can find the detailed changelog here.
Recently, a bigger part of the former core maintainers (thanks to all your hard work!) have been rather busy. Hence, the available time to look after our beloved ORM has been shrinking and shrinking drastically, generating a great chance for you:
We are looking for more core maintainers who are interested in improving/fixing our TypeScript typings, improving the documentation, organizing issues, reviewing PRs, streamlining the overall code base and planning the future roadmap.
If that sounds interesting to you, please reach out to us on our Slack channel by sending a direct message to Pedro A P B. If you don't have access, get yourself an invite automatically via this link. We are looking forward to meet you!
$ npm i sequelize # This will install v6 # And one of the following: $ npm i pg pg-hstore # Postgres $ npm i mysql2 $ npm i mariadb $ npm i sqlite3 $ npm i tedious # Microsoft SQL Server
If you have security issues to report, please refer to our Responsible Disclosure Policy for more details.
very poor documentation, especially when you come to use it with associations( one to one , one to many and many to many relations ) , while using it u have to import a lot of libraries , when you delete data that have a many to many elation the joins table doesnt delete the record, you have to use a lot of code to finally reach ur goal , i ve used Eloquent in Laravel and it is way better and documented and when it comes to the associations it makes it easy with its functions like attach detach and sync, if i have to choose between using sequelize as an ORM or just SQL i ll probably chose to write SQL queries.
Sequelize is probably one of the first libraries you'll learn when watching YouTube videos about making a node powered backend. Though it is very popular and battle-tested, I've always found using sequelize a hassle. It requires a lot of boilerplate and feels very outdated. The documentation is pretty lacking in information as well. I recommend looking at knex as a lightweight alternative.
Horrible documentation. Sequelize primarily uses code to create tables via the .sync() method vs using migrations. Migrations are possible, but documentation is poor. You have to write your own models and then write your own migrations as well instead of using a command to create them from the model files. Eager loading is easy if you want all the data. Filtering eager loaded data using the where clause is easy, but limiting eager loaded data is not possible.
The package provides a huge example of abstraction and loosely coupled database. Using sequelize in our project gave us the confidence that we could scale up easily as well as switch to any other database system without much refactoring in our project code base.
Really love the sync feature for super fast prototyping. I've also been really impressed with the way they manage issue submission (SSCCE repo to submit an example with tests!). The docs are pretty good, but could REALLY do with a working search feature! All in all, sequelize has become my go to ORM for node.