Core ORM hook for Sails.js that integrates Waterline ORM into the Sails framework. Version 4.0.3 loads adapters and models, hydrates them via Waterline, and exposes them as sails.models and optional globals. Released as part of Sails v1, with a stable release cadence following Sails releases. Key differentiators: automatic model loading from api/models, auto-migration prompts, and built-in sails-disk adapter. ESM-only since v2.
npm install sails-hook-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Installs the ORM hook, lifts a Sails app with default disk adapter, creates a User model, and queries all users.
Switch to ES module imports: import 'sails-hook-orm' and use import for sails.
Use the identity defined in the model (usually lowercase filename).
Set sails.config.models.migrate explicitly to 'safe', 'alter', or 'drop' in your app configuration.
Ensure those core hooks are enabled or load dependencies manually.
Use .then() or await with model methods.
Access models via sails.models if globals are disabled.
Run npm install sails-hook-orm.
Add "type": "module" to package.json or rename file to .mjs.
Ensure model file exists and datastore adapter is installed.
Check that all required core hooks are enabled and configuration is valid.