{"id":42355,"library":"zbmy-orm","title":"Zbmy ORM","description":"Zbmy ORM is a Node.js ORM wrapper around Sequelize that supports read/write database separation, Oracle and MySQL dialects, and transaction management. Version 1.0.26 is the latest stable release. It provides a simplified API for common CRUD operations, SQL queries, and model definitions. Released under ISC license. Differentiators include built-in read/write splitting, Oracle support via dialect configuration, and a straightforward initialization pattern. Maintained by Zhongbei Mingyi.","status":"active","version":"1.0.26","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install zbmy-orm","lang":"bash","label":"npm"},{"cmd":"yarn add zbmy-orm","lang":"bash","label":"yarn"},{"cmd":"pnpm add zbmy-orm","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"ORM is a wrapper around Sequelize; models and queries use Sequelize internally","package":"sequelize","optional":false}],"imports":[{"note":"Package uses CommonJS exports; ESM import not supported.","wrong":"import orm from 'zbmy-orm';","symbol":"orm","correct":"const orm = require('zbmy-orm');"},{"note":"Sequelize is a peer dependency; must be required separately for model definitions.","wrong":"const Sequelize = require('zbmy-orm').Sequelize;","symbol":"Sequelize (for model definitions)","correct":"const Sequelize = require('sequelize');"},{"note":"init expects separate arguments: connection name, type, and config object.","wrong":"orm.init({ dialect: 'mysql', type: 'read', ...config });","symbol":"init","correct":"orm.init('mysql','read', config);"}],"quickstart":{"code":"const path = require('path');\nconst orm = require('zbmy-orm');\n\nconst config = {\n  dialect: 'mysql',\n  database: 'dbName',\n  username: 'xxx',\n  password: 'xxx',\n  option: {\n    dialect: 'mysql'\n  },\n  modelPath: path.join(__dirname, 'models')\n};\n\norm.init('mydb', 'all', config);\n\n// Define a model (in models/company.js)\nconst Sequelize = require('sequelize');\nmodule.exports = function(sequelize) {\n  return sequelize.define('company', {\n    _id: {\n      type: Sequelize.UUID,\n      primaryKey: true,\n      defaultValue: Sequelize.UUIDV1\n    },\n    name: {\n      type: Sequelize.STRING\n    }\n  }, {\n    freezeTableName: true,\n    timestamps: false\n  });\n};\n\n// Use the ORM\norm('company').findAll({ where: { _id: 'some-id' } }, function(err, result) {\n  if (err) console.error(err);\n  else console.log(result);\n});","lang":"javascript","description":"Initializes ORM with read-write config, defines a model using Sequelize, and performs a findAll query."},"warnings":[{"fix":"Use path.join(__dirname, 'models') or absolute path.","message":"Model path must be absolute; relative paths may fail.","severity":"gotcha","affected_versions":"all"},{"fix":"Call orm.init('mydb', 'all', config) not orm.init(config).","message":"init function expects three arguments: name, type, config. Passing a single object will not work.","severity":"gotcha","affected_versions":"all"},{"fix":"Use callbacks or wrap with util.promisify.","message":"ORM returns query results via callback; does not support Promises natively.","severity":"gotcha","affected_versions":"all"},{"fix":"Run npm install sequelize alongside zbmy-orm.","message":"Sequelize is a peer dependency not included; must be installed separately.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.0.26':25 'api':35 'around':10 'built':52 'built-in':51 'common':37 'configur':60 'crud':38 'databas':15 'definit':44 'dialect':20,59 'differenti':49 'includ':50 'initi':64 'isc':47 'javascript':70 'latest':28 'licens':48 'maintain':66 'manag':23 'mingyi':69 'model':43 'mysql':19 'node.js':7 'oper':39 'oracl':17,56 'orm':2,4,8 'pattern':65 'provid':32 'queri':41 'read/write':14,54 'releas':30,45 'separ':16 'sequel':11 'simplifi':34 'split':55 'sql':40 'stabl':29 'straightforward':63 'support':13,57 'transact':22 'version':24 'via':58 'wrapper':9 'zbmi':1,3 'zhongbei':68","created_at":"2026-06-04T18:56:51.414827+00:00","updated_at":"2026-06-04T18:56:51.414827+00:00","problems":[{"fix":"npm install sequelize","cause":"Sequelize peer dependency not installed.","error":"Cannot find module 'sequelize'"},{"fix":"Ensure modelPath points to directory with valid model files that export a function.","cause":"Model not registered; modelPath incorrect or model file not found.","error":"Error: Cannot read property 'findAll' of undefined"},{"fix":"Use const orm = require('zbmy-orm'); (not named import)","cause":"Incorrect export import; zbmy-orm exports a function, not an object.","error":"TypeError: orm.init is not a function"},{"fix":"Ensure oracle driver (e.g., oracledb) is installed and config option includes dialect: 'oracle'.","cause":"Oracle dialect requires additional setup or dependency issue.","error":"Dialect 'oracle' 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":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"zbmy-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}}