{"id":42692,"library":"egg-zing-orm","title":"egg-zing-orm","description":"An Egg.js plugin integrating ZingOrm, a simple ORM for Node.js. Version 0.3.5 targets Node >=8.0.0. As a plugin, it provides declarative model configuration and lifecycle management within the Egg framework. Compared to standalone ORMs like Sequelize or TypeORM, it offers tighter integration with Egg's app/agent pattern, but lacks ecosystem maturity and documentation.","status":"active","version":"0.3.5","language":"javascript","source_language":"en","source_url":"https://github.com/elixirChain/egg-zing-orm","tags":["javascript","egg","eggPlugin","egg-plugin","eggZingOrm","egg-zing-orm","ZingOrm","orm"],"install":[{"cmd":"npm install egg-zing-orm","lang":"bash","label":"npm"},{"cmd":"yarn add egg-zing-orm","lang":"bash","label":"yarn"},{"cmd":"pnpm add egg-zing-orm","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Use ESM import for Egg plugins; requires egg framework.","wrong":"const zingOrm = require('egg-zing-orm')","symbol":"default","correct":"import zingOrm from 'egg-zing-orm'"},{"note":"Egg plugin exposes via app.zingOrm; cannot be imported directly.","wrong":"import { zingOrm } from 'egg-zing-orm'","symbol":"app.zingOrm","correct":"// config/plugin.js\nmodule.exports = { zingOrm: { enable: true, package: 'egg-zing-orm' } };\n// Then use app.zingOrm in service"},{"note":"Models are defined using app.zingOrm.define, not imported.","wrong":"import { Model } from 'egg-zing-orm'","symbol":"Model","correct":"// app/model/user.js\nmodule.exports = app => {\n  const { INTEGER, STRING } = app.zingOrm;\n  return app.zingOrm.define('user', { name: STRING, age: INTEGER });\n};"}],"quickstart":{"code":"// config/plugin.js\nexports.zingOrm = { enable: true, package: 'egg-zing-orm' };\n\n// config/config.default.js\nexports.zingOrm = {\n  client: {\n    host: process.env.DB_HOST || 'localhost',\n    port: 3306,\n    user: process.env.DB_USER || 'root',\n    password: process.env.DB_PASS || '',\n    database: 'test'\n  }\n};\n\n// app/model/user.js\nmodule.exports = app => {\n  const { STRING, INTEGER } = app.zingOrm;\n  return app.zingOrm.define('user', {\n    name: STRING(50),\n    age: INTEGER\n  });\n};\n\n// app/service/user.js\nconst Service = require('egg').Service;\nclass UserService extends Service {\n  async list() {\n    return await this.app.zingOrm.model.user.findAll();\n  }\n}\nmodule.exports = UserService;\n","lang":"javascript","description":"Shows basic Egg plugin setup, model definition, and service usage with egg-zing-orm."},"warnings":[{"fix":"Add `zingOrm: { enable: true, package: 'egg-zing-orm' }` to config/plugin.js","message":"Plugin must be enabled in config/plugin.js before use","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use `module.exports = app => { ... }` and place in app/model/","message":"Model files must follow Egg.js convention: placed in app/model/ and export a function receiving app","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Upgrade Egg.js to version 2+ and Node to 8+","message":"Requires Egg.js >= 2.x and Node >= 8.0.0","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Pin exact version in package.json: \"egg-zing-orm\": \"0.3.5\"","message":"Breaking changes may occur between minor versions (pre-1.0 semver)","severity":"breaking","affected_versions":"<1.0.0"}],"env_vars":null,"search_vec":"'0.3.5':16 '8.0.0':19 'app/agent':50 'compar':35 'configur':27 'declar':25 'document':57 'ecosystem':54 'egg':2,33,48,59,62,66 'egg-plugin':61 'egg-zing-orm':1,65 'egg.js':6 'eggplugin':60 'eggzingorm':64 'framework':34 'integr':8,46 'javascript':58 'lack':53 'lifecycl':29 'like':39 'manag':30 'matur':55 'model':26 'node':18 'node.js':14 'offer':44 'orm':4,12,38,68,70 'pattern':51 'plugin':7,22,63 'provid':24 'sequel':40 'simpl':11 'standalon':37 'target':17 'tighter':45 'typeorm':42 'version':15 'within':31 'zing':3,67 'zingorm':9,69","created_at":"2026-06-05T16:56:12.068795+00:00","updated_at":"2026-06-05T16:56:12.068795+00:00","problems":[{"fix":"Install: `npm install egg-zing-orm` and enable in config/plugin.js","cause":"Plugin not installed or enabled","error":"Cannot find module 'egg-zing-orm'"},{"fix":"Ensure config/plugin.js has `zingOrm: { enable: true, package: 'egg-zing-orm' }` and restart app","cause":"Plugin not enabled in config/plugin.js or not started correctly","error":"app.zingOrm is undefined"},{"fix":"Update config/config.default.js with correct DB_HOST, DB_USER, DB_PASS","cause":"Incorrect database credentials in config","error":"ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost'"}],"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/elixirChain/egg-zing-orm#readme","github":"https://github.com/elixirChain/egg-zing-orm","docs":null,"changelog":null,"pypi":null,"npm":"egg-zing-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-05","next_check":"2026-09-03","install_tag":null}}