Sequelize adapter for Moleculer DB service, providing SQL database support (Postgres, MySQL, SQLite, MSSQL) for microservice architectures. Current version 0.3.0, maintained by MoleculerJS team. Integrates seamlessly with moleculer-db, supporting both Sequelize v5 and v6. Requires manual installation of database-specific drivers. TypeScript declarations included. Simpler than using raw Sequelize with Moleculer by providing adapter pattern and model definition in service schema.
npm install moleculer-db-adapter-sequelizeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a Moleculer service with Sequelize adapter using SQLite in-memory database and shows basic create/find operations.
Upgrade Node.js to v22+ or use an older adapter version (e.g., 0.2.x) with Node 18.
Use sequelize ^6.7.0 or later; update model definitions accordingly (e.g., no need for db.Model).
Consult Sequelize documentation for valid constructor arguments (URI string or (database, username, password, options)).
Install required driver: sqlite3, mysql2, mariadb, pg (and pg-hstore), or tedious.
Set freezeTableName: true in model options to disable pluralization.
Run `npm install sequelize`.
Use `const SqlAdapter = require('moleculer-db-adapter-sequelize');` (no destructuring).Add dialect: 'mysql' (or appropriate) in options object, or use URI like 'mysql://...'.
Ensure model object includes 'define' with valid Sequelize attribute definitions.