A Sails.js hook that integrates Sequelize ORM as the database layer, replacing the default Waterline ORM. Version 2.0.1 is the latest stable; it requires Node >=12 and supports Sequelize 6+. Unlike Waterline, this hook provides direct access to Sequelize models and associations, enabling complex SQL queries, transactions, and raw database features. It requires disabling the built-in ORM and pubsub hooks, and models must follow a specific structure with an `options` key and optional `associations` function. Released under MIT, maintained by KSDaemon.
npm install sails-hook-sequelizeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures Sails to use Sequelize with PostgreSQL, defines a User model, and sets up an association with an Image model.
Add '{"hooks": {"orm": false, "pubsub": false}}' to .sailsrc.Update model attributes to specify lengths where applicable.
Add 'options: {}' to model definition.Include 'dialect' in both the connection object and its 'options' sub-object.
Upgrade Node.js to >=12.
Add `dialect: 'postgres'` (or your dialect) to the connection object and its options if present.
Add `options: {}` to the model definition.Add `connection: 'myConnection'` to the model or set `models.connection` in config.
Ensure .sailsrc disables ORM hook, and the hook is installed.