Registry / database / modella-mysql

modella-mysql

JSON →
library0.13.5jsnpmunverified

MySQL storage plugin and persistence layer for Modella ORM. Current version 0.13.5 (pre-1.0), last published in 2014, no recent releases. Provides MySQL persistence for Modella models with CRUD operations, pagination support, and relationship definitions (hasMany, belongsTo, hasAndBelongsToMany). Compared to other Modella backends, it uses node-mysql and offers event hooks for save/update lifecycle. However, the package is unmaintained, has no TypeScript support, and relies on outdated dependencies. Suitable only for legacy projects still using Modella.

npm install modella-mysql
INSTALL
IMPORT
SIG · MODELLA-MYSQL
M
modella-mysql
databasejavascriptv0.13.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

modella-mysql
var mysql = require('modella-mysql');
import mysql from 'modella-mysql';
Package is CommonJS only, no ESM support. Use require().
Modella
var modella = require('modella');
import { Modella } from 'modella';
Modella itself is also CommonJS. ESM import will fail.
plugin usage
User.use(mysql({ database: 'mydb', user: 'root' }));
User.use(new mysql({...}))
mysql() returns a plugin function, not an instance. Do not use 'new'.

Sets up a Modella model with MySQL persistence, defines attributes, and executes a query with pagination support.

var modella = require('modella'); var mysql = require('modella-mysql'); var User = modella('User'); User.attr('name', { required: true }); User.attr('city', { required: true }); User.use(mysql({ database: 'mydb', user: 'root', password: process.env.MYSQL_PASSWORD || '' })); User.all({ where: { city: 'San Francisco' } }, function(err, result) { if (err) return console.error(err); console.log(result.data); });
Debug
Known issues
gotchaPackage is unmaintained since 2014. No security updates, compatibility issues with modern Node.js runtimes.
fix
Consider migrating to an active ORM like Sequelize, TypeORM, or Prisma.
affects: *
breakingNode.js >= 0.8 only. Uses deprecated Buffer API and other legacy patterns. Will not work on Node >= 10 without polyfills.
fix
Use Node 8.x or lower, or migrate to a maintained alternative.
affects: >=10.0.0
deprecatedThe `all` method with pagination is marked as experimental. API may change in future releases.
fix
No fix available since library is abandoned. Avoid relying on pagination behavior.
affects: <=0.13.5
Errors
Common errors & fixes
Cannot find module 'modella-mysql'
Package not installed or not in node_modules.
fix
Run `npm install modella-mysql` in your project directory.
TypeError: modella is not a function
Modella module imported incorrectly or not installed.
fix
Ensure modella is installed: `npm install modella`. Use `var modella = require('modella');`.
Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'user'@'localhost' (using password: YES)
Incorrect MySQL credentials or missing password.
fix
Verify database user, password, and host. Use environment variables for sensitive data.
Upgrade
Version history
0.13.5latest on npm
Audit
Dependencies
modellarequiredpeer dependency: this plugin requires the Modella ORM to be installed
mysqlrequiredruntime dependency: provides MySQL database connectivity via node-mysql
Agent activity
2 hits · last 30 days
node
2
Resources
modella-mysql — npm install modella-mysql · libregistry