Registry / database / clever-orm

clever-orm

JSON →
library2.0.9jsnpmunverified

CleverStack ORM Module deeply integrates SequelizeJS into the CleverStack framework to provide an out-of-the-box Object Relational Mapper for SQL databases. Version 2.0.9 is the latest release, targeting Node.js 0.10-0.12 and npm 1.4-2.5. It supports MySQL, PostgreSQL, and SQLite. The module is part of the CleverStack ecosystem, offering enterprise-grade SQL database integration with features like model definitions, migrations, and seeding. It is designed for use within CleverStack projects and is not intended as a standalone ORM. The module is in maintenance mode due to the age of its dependencies and Node.js version constraints. Key differentiators include tight integration with CleverStack's module system and CLI tooling, but it is not recommended for new projects outside of the CleverStack framework.

npm install clever-orm
INSTALL
IMPORT
SIG · CLEVER-ORM
C
clever-orm
databasejavascriptv2.0.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default export
✓ import CleverORM from 'clever-orm';
✗ const CleverORM = require('clever-orm').default;
Package exports a single constructor function that sets up Sequelize integration. Use default import.
Service
✓ import { Service } from 'clever-orm';
✗ const Service = require('clever-orm').Service;
Named export for the ORM service class, used within CleverStack modules.
Model
✓ import { Model } from 'clever-orm';
✗ const Model = require('clever-orm').Model;
Named export for the base model class that all ORM models should extend.

Shows how to initialize CleverORM with SQLite, define a model using the base Model class, register it, sync the database, and create a record.

import CleverORM from 'clever-orm'; import { Service, Model } from 'clever-orm'; const orm = new CleverORM({ dialect: 'sqlite', storage: ':memory:', logging: false }); class User extends Model { static init(sequelize) { super.init({ name: { type: sequelize.Sequelize.STRING, allowNull: false }, }, { sequelize, modelName: 'user' }); } } const service = new Service(orm); service.registerModel(User); await service.sync(); const user = await service.models.User.create({ name: 'John' }); console.log(user.toJSON());
Debug
Known issues
deprecatedThis package is no longer actively maintained. Its dependencies, especially Sequelize, are outdated.
fix
Consider migrating to a modern ORM like Sequelize directly or TypeORM.
affects: all
breakingNode.js engine requirement is >=0.10 <=0.12. Does not support modern Node versions (>=13).
fix
Use an older Node version or update the package source code to support newer Node.js.
affects: all
breakingnpm engine requirement is >=1.4 <=2.5. Modern npm versions may cause installation issues.
fix
Use an older npm version or install with --ignore-engines flag.
affects: all
gotchaThe package is tightly coupled to the CleverStack framework and may not work standalone without proper configuration.
fix
Ensure you have the CleverStack CLI and project structure. Alternatively, use Sequelize directly.
affects: all
gotchaModel.init() method requires calling super.init() with the sequelize instance and model options. Forgetting this will result in a runtime error.
fix
Always include super.init(attributes, { sequelize, modelName: 'yourmodelname' }); in your model class.
affects: >=2.0.0
deprecatedThe module uses Grunt for database tasks. Grunt is considered deprecated in favor of more modern tools.
fix
Replace Grunt tasks with npm scripts or other task runners.
affects: all
Errors
Common errors & fixes
Cannot find module 'clever-orm'
Package not installed or not in node_modules.
fix
Run `clever install clever-orm` from your project root or `npm install clever-orm --save`.
Sequelize is not a constructor
Incorrect import of Sequelize from clever-orm. The package exposes a constructor, not a Sequelize instance.
fix
Use the default export: `import CleverORM from 'clever-orm';` then instantiate with `new CleverORM({...})`.
Model does not have a sync method
Trying to call .sync() on a single Model class instead of using the service.
fix
Use `service.sync()` to sync all registered models. For individual sync, use `model.sync()` after initialization.
Dialect 'postgre' is not supported
Typo in dialect name. Valid options: 'mysql', 'postgres', 'sqlite', 'mariadb', 'mssql'.
fix
Change dialect to 'postgres' or 'postgresql'.
Upgrade
Version history
2.0.9latest on npm
Audit
Dependencies
sequelizerequiredCore ORM library that provides the actual database abstraction
clever-localsoptionalCleverStack dependency for managing local module configuration
Agent activity
13 hits · last 30 days
node
10
OpenAI (training)
1
Resources
clever-orm — npm install clever-orm · libregistry