{"id":40726,"library":"clever-orm","title":"CleverStack ORM Module","description":"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.","status":"maintenance","version":"2.0.9","language":"javascript","source_language":"en","source_url":"https://github.com/CleverStack/clever-orm","tags":["javascript","cleverstack","cleverstack-module","cleverstack-backend","orm","sequelize","backend","mysql","postgre"],"install":[{"cmd":"npm install clever-orm","lang":"bash","label":"npm"},{"cmd":"yarn add clever-orm","lang":"bash","label":"yarn"},{"cmd":"pnpm add clever-orm","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core ORM library that provides the actual database abstraction","package":"sequelize","optional":false},{"reason":"CleverStack dependency for managing local module configuration","package":"clever-locals","optional":true}],"imports":[{"note":"Package exports a single constructor function that sets up Sequelize integration. Use default import.","wrong":"const CleverORM = require('clever-orm').default;","symbol":"default export","correct":"import CleverORM from 'clever-orm';"},{"note":"Named export for the ORM service class, used within CleverStack modules.","wrong":"const Service = require('clever-orm').Service;","symbol":"Service","correct":"import { Service } from 'clever-orm';"},{"note":"Named export for the base model class that all ORM models should extend.","wrong":"const Model = require('clever-orm').Model;","symbol":"Model","correct":"import { Model } from 'clever-orm';"}],"quickstart":{"code":"import CleverORM from 'clever-orm';\nimport { Service, Model } from 'clever-orm';\n\nconst orm = new CleverORM({\n  dialect: 'sqlite',\n  storage: ':memory:',\n  logging: false\n});\n\nclass User extends Model {\n  static init(sequelize) {\n    super.init({\n      name: {\n        type: sequelize.Sequelize.STRING,\n        allowNull: false\n      },\n    }, { sequelize, modelName: 'user' });\n  }\n}\n\nconst service = new Service(orm);\nservice.registerModel(User);\n\nawait service.sync();\nconst user = await service.models.User.create({ name: 'John' });\nconsole.log(user.toJSON());","lang":"typescript","description":"Shows how to initialize CleverORM with SQLite, define a model using the base Model class, register it, sync the database, and create a record."},"warnings":[{"fix":"Consider migrating to a modern ORM like Sequelize directly or TypeORM.","message":"This package is no longer actively maintained. Its dependencies, especially Sequelize, are outdated.","severity":"deprecated","affected_versions":"all"},{"fix":"Use an older Node version or update the package source code to support newer Node.js.","message":"Node.js engine requirement is >=0.10 <=0.12. Does not support modern Node versions (>=13).","severity":"breaking","affected_versions":"all"},{"fix":"Use an older npm version or install with --ignore-engines flag.","message":"npm engine requirement is >=1.4 <=2.5. Modern npm versions may cause installation issues.","severity":"breaking","affected_versions":"all"},{"fix":"Ensure you have the CleverStack CLI and project structure. Alternatively, use Sequelize directly.","message":"The package is tightly coupled to the CleverStack framework and may not work standalone without proper configuration.","severity":"gotcha","affected_versions":"all"},{"fix":"Always include super.init(attributes, { sequelize, modelName: 'yourmodelname' }); in your model class.","message":"Model.init() method requires calling super.init() with the sequelize instance and model options. Forgetting this will result in a runtime error.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Replace Grunt tasks with npm scripts or other task runners.","message":"The module uses Grunt for database tasks. Grunt is considered deprecated in favor of more modern tools.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"search_vec":"'-0.12':37 '-2.5':41 '0.10':36 '1.4':40 '2.0.9':29 'age':96 'backend':137,140 'box':21 'cleverstack':1,4,12,54,77,110,128,131,133,136 'cleverstack-backend':135 'cleverstack-modul':132 'cli':115 'constraint':103 'databas':27,61 'deepli':7 'definit':67 'depend':99 'design':73 'differenti':105 'due':93 'ecosystem':55 'enterpris':58 'enterprise-grad':57 'featur':64 'framework':13,129 'grade':59 'includ':106 'integr':8,62,108 'intend':82 'javascript':130 'key':104 'latest':32 'like':65 'mainten':91 'mapper':24 'migrat':68 'mode':92 'model':66 'modul':3,6,49,88,112,134 'mysql':44,141 'new':123 'node.js':35,101 'npm':39 'object':22 'offer':56 'orm':2,5,86,138 'out-of-the-box':17 'outsid':125 'part':51 'postgr':142 'postgresql':45 'project':78,124 'provid':15 'recommend':121 'relat':23 'releas':33 'seed':70 'sequel':139 'sequelizej':9 'sql':26,60 'sqlite':47 'standalon':85 'support':43 'system':113 'target':34 'tight':107 'tool':116 'use':75 'version':28,102 'within':76","created_at":"2026-06-04T18:48:58.088765+00:00","updated_at":"2026-06-04T18:48:58.088765+00:00","problems":[{"fix":"Run `clever install clever-orm` from your project root or `npm install clever-orm --save`.","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'clever-orm'"},{"fix":"Use the default export: `import CleverORM from 'clever-orm';` then instantiate with `new CleverORM({...})`.","cause":"Incorrect import of Sequelize from clever-orm. The package exposes a constructor, not a Sequelize instance.","error":"Sequelize is not a constructor"},{"fix":"Use `service.sync()` to sync all registered models. For individual sync, use `model.sync()` after initialization.","cause":"Trying to call .sync() on a single Model class instead of using the service.","error":"Model does not have a sync method"},{"fix":"Change dialect to 'postgres' or 'postgresql'.","cause":"Typo in dialect name. Valid options: 'mysql', 'postgres', 'sqlite', 'mariadb', 'mssql'.","error":"Dialect 'postgre' is not supported"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/CleverStack/clever-orm#readme","github":"https://github.com/CleverStack/clever-orm","docs":null,"changelog":null,"pypi":null,"npm":"clever-orm","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}