{"id":41176,"library":"grind-orm","title":"Grind ORM","description":"Grind ORM is an ORM provider for the Grind framework, integrating Objection.js to provide full ES6/7 class-based Models and helpers. Current stable version is 0.8.0, with beta peer dependencies on grind-db and grind-framework. It follows the main Grind release cadence and differentiates by tightly coupling with Grind's architecture, offering familiar patterns for Grind users.","status":"active","version":"0.8.0","language":"javascript","source_language":"en","source_url":"https://github.com/grindjs/grindjs","tags":["javascript","grindjs","grind-framework","objectionjs","orm"],"install":[{"cmd":"npm install grind-orm","lang":"bash","label":"npm"},{"cmd":"yarn add grind-orm","lang":"bash","label":"yarn"},{"cmd":"pnpm add grind-orm","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for database connectivity","package":"grind-db","optional":false},{"reason":"Peer dependency required for framework integration","package":"grind-framework","optional":false}],"imports":[{"note":"ESM default; CommonJS require also works but is not recommended for new code.","wrong":"const Model = require('grind-orm').Model","symbol":"Model","correct":"import { Model } from 'grind-orm'"},{"note":"Named export, not default. The provider class is named export.","wrong":"import GrindORMProvider from 'grind-orm'","symbol":"GrindORMProvider","correct":"import { GrindORMProvider } from 'grind-orm'"},{"note":"Provides access to the underlying Objection.js instance for advanced use.","wrong":"const Objection = require('grind-orm').Objection","symbol":"Objection","correct":"import { Objection } from 'grind-orm'"}],"quickstart":{"code":"import { GrindORMProvider, Model } from 'grind-orm';\nimport { App } from 'grind-framework';\nimport { GrindDbProvider } from 'grind-db';\n\nconst app = new App();\napp.register(GrindDbProvider);\napp.register(GrindORMProvider);\n\nclass User extends Model {\n  static tableName = 'users';\n  static jsonSchema = {\n    type: 'object',\n    required: ['name', 'email'],\n    properties: {\n      id: { type: 'integer' },\n      name: { type: 'string', minLength: 1, maxLength: 255 },\n      email: { type: 'string' },\n    },\n  };\n}\n\nexport default User;","lang":"typescript","description":"Shows how to import and use Grind ORM with a simple Model class and register providers."},"warnings":[{"fix":"Ensure all three packages are version 0.8.x.","message":"Peer dependencies must be version-compatible; grind-db and grind-framework must match the same major version range as grind-orm.","severity":"breaking","affected_versions":">=0.8.0"},{"fix":"Pin exact versions and monitor releases.","message":"The package is in early beta; API may change without notice.","severity":"deprecated","affected_versions":"<1.0.0"},{"fix":"Always define static tableName in Model subclasses.","message":"Model must have a static tableName property; otherwise Objection throws an error.","severity":"gotcha","affected_versions":"*"},{"fix":"Register GrindDbProvider before GrindORMProvider.","message":"Using Model without registering GrindDbProvider will cause runtime errors.","severity":"gotcha","affected_versions":"*"},{"fix":"Update import statements to use the main package entry.","message":"In version 0.7.x, the import path was different; upgrade to 0.8.x requires changing imports from 'grind-orm/lib/...' to 'grind-orm'.","severity":"breaking","affected_versions":"<0.8.0"}],"env_vars":null,"search_vec":"'0.8.0':29 'architectur':57 'base':21 'beta':31 'cadenc':48 'class':20 'class-bas':19 'coupl':53 'current':25 'db':37 'depend':33 'differenti':50 'es6/7':18 'familiar':59 'follow':43 'framework':12,41,68 'full':17 'grind':1,3,11,36,40,46,55,62,67 'grind-db':35 'grind-framework':39,66 'grindj':65 'helper':24 'integr':13 'javascript':64 'main':45 'model':22 'objection.js':14 'objectionj':69 'offer':58 'orm':2,4,7,70 'pattern':60 'peer':32 'provid':8,16 'releas':47 'stabl':26 'tight':52 'user':63 'version':27","created_at":"2026-06-04T18:51:08.553993+00:00","updated_at":"2026-06-04T18:51:08.553993+00:00","problems":[{"fix":"Run npm install grind-db@^0.8.0-beta.1","cause":"Missing peer dependency grind-db.","error":"Cannot find module 'grind-db'"},{"fix":"Register GrindDbProvider and ensure db config exists.","cause":"GrindDbProvider not registered or database connection not configured.","error":"Model .query() is not a function"},{"fix":"Use import { Model } from 'grind-orm' (named import).","cause":"Importing Model incorrectly (e.g., default import instead of named).","error":"TypeError: Class extends value undefined is not a constructor or null"},{"fix":"Add static keyword: static tableName = 'users';","cause":"Defining tableName as instance property instead of static.","error":"Unknown model property: tableName"}],"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/grindjs/grindjs/tree/master/packages/orm#readme","github":"https://github.com/grindjs/grindjs","docs":null,"changelog":null,"pypi":null,"npm":"grind-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}}