{"id":43306,"library":"mysql-model","title":"mysql-model","description":"A lightweight, Backbone-inspired ORM for Node.js that wraps felixge/node-mysql to provide model-based CRUD operations on MySQL databases. Version 0.0.3 is the latest and likely final release, with no updates since its initial publication. It offers a familiar extend/save/find/remove pattern for developers coming from Backbone.js, but requires manual creation of connection instances and lacks modern features like promise support, migrations, or schema validation. Alternatives like Sequelize, Bookshelf, or Knex are more actively maintained and feature-rich.","status":"abandoned","version":"0.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/michalkow/node-mysql-model","tags":["javascript","node","mysql","model","models","orm","backbone","node-mysql","database"],"install":[{"cmd":"npm install mysql-model","lang":"bash","label":"npm"},{"cmd":"yarn add mysql-model","lang":"bash","label":"yarn"},{"cmd":"pnpm add mysql-model","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Underlying MySQL driver for database connections and queries.","package":"mysql","optional":false},{"reason":"Used for model inheritance and event system.","package":"backbone","optional":false}],"imports":[{"note":"Package uses CommonJS, no default ESM export available.","wrong":"import mysqlModel from 'mysql-model';","symbol":"default","correct":"const mysqlModel = require('mysql-model');"},{"note":"createConnection is a static method, not a constructor.","wrong":"const MyModel = new mysqlModel.createConnection({ host: '...' });","symbol":"mysqlModel.createConnection","correct":"const MyModel = mysqlModel.createConnection({ host: '...' });"},{"note":"Uses Backbone's extend pattern.","wrong":"const Movie = MyModel.extends({ tableName: 'movies' });","symbol":"MyModel.extend","correct":"const Movie = MyModel.extend({ tableName: 'movies' });"}],"quickstart":{"code":"const mysqlModel = require('mysql-model');\n\nconst MyAppModel = mysqlModel.createConnection({\n  host: process.env.DB_HOST || 'localhost',\n  user: process.env.DB_USER || 'root',\n  password: process.env.DB_PASS || '',\n  database: process.env.DB_NAME || 'test'\n});\n\nconst Movie = MyAppModel.extend({\n  tableName: 'movies'\n});\n\nconst movie = new Movie({ name: 'Serenity', year: 2005 });\nmovie.save(function(err) {\n  if (err) console.error(err);\n  else console.log('Saved movie with id:', movie.get('id'));\n});","lang":"javascript","description":"Creates a database connection, defines a Movie model, and saves a new record."},"warnings":[{"fix":"Migrate to an actively maintained ORM like Sequelize or Bookshelf.","message":"Package is effectively abandoned; no updates since 2015. Use at your own risk in production.","severity":"deprecated","affected_versions":">=0.0.1"},{"fix":"Run 'npm install backbone' explicitly.","message":"The library expects 'backbone' to be installed separately, but does not list it as a dependency in package.json.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Call movie.off() or movie.remove() when done.","message":"Model instances are eventful (Backbone events) which may cause memory leaks if not properly cleaned up.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Manually set attributes before calling save, or use 'query' for custom SQL.","message":"The 'save' method does not support partial updates; it sends the entire model attributes as the SQL SET clause.","severity":"breaking","affected_versions":">=0.0.1"}],"env_vars":null,"search_vec":"'0.0.3':26 'activ':78 'altern':70 'backbon':7,90 'backbone-inspir':6 'backbone.js':51 'base':19 'bookshelf':73 'come':49 'connect':57 'creation':55 'crud':20 'databas':24,94 'develop':48 'extend/save/find/remove':45 'familiar':44 'featur':62,82 'feature-rich':81 'felixge/node-mysql':14 'final':32 'initi':39 'inspir':8 'instanc':58 'javascript':84 'knex':75 'lack':60 'latest':29 'lightweight':5 'like':31,63,71 'maintain':79 'manual':54 'migrat':66 'model':3,18,87,88 'model-bas':17 'modern':61 'mysql':2,23,86,93 'mysql-model':1 'node':85,92 'node-mysql':91 'node.js':11 'offer':42 'oper':21 'orm':9,89 'pattern':46 'promis':64 'provid':16 'public':40 'releas':33 'requir':53 'rich':83 'schema':68 'sequel':72 'sinc':37 'support':65 'updat':36 'valid':69 'version':25 'wrap':13","created_at":"2026-06-05T16:59:10.115756+00:00","updated_at":"2026-06-05T16:59:10.115756+00:00","problems":[{"fix":"npm install backbone","cause":"Backbone is not automatically installed as a dependency of mysql-model.","error":"Error: Cannot find module 'backbone'"},{"fix":"const MyAppModel = mysqlModel.createConnection({...}); // no new","cause":"Calling new on createConnection instead of using it as a static method.","error":"TypeError: mysqlModel.createConnection is not a constructor"},{"fix":"Verify host, user, password, and database values.","cause":"Invalid database credentials passed to createConnection.","error":"Error: ER_ACCESS_DENIED_ERROR: Access denied for user ..."}],"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/michalkow/node-mysql-model#readme","github":"https://github.com/michalkow/node-mysql-model","docs":null,"changelog":null,"pypi":null,"npm":"mysql-model","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}}