Registry / database / mysql-dynamo

mysql-dynamo

JSON →
library0.3.3jsnpmunverified

An adapter that provides the simple-dynamo interface over a MySQL database, enabling offline/local development for AWS DynamoDB projects. Version 0.3.3 is the latest stable release (last updated in 2014). This package is in maintenance mode and not actively developed. Keys differences from Dynamo: table config options like `consistent`, `overwriteExistingHash`, and `combineTableTo` are not supported; undefined attributes in items are ignored; field lengths must be explicitly defined. Written in CoffeeScript, primarily for Node.js 0.8+.

npm install mysql-dynamo
INSTALL
IMPORT
SIG · MYSQL-DYNAMO
M
mysql-dynamo
databasejavascriptv0.3.3
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.

MySqlDynamo
import MySqlDynamo from 'mysql-dynamo'
const MySqlDynamo = require('mysql-dynamo')
Package does not export CommonJS module; it provides a default export. CoffeeScript or ES6 import syntax is expected.

Shows initialization of MySqlDynamo with MySQL connection and table definition, then creating a table and inserting an item.

import MySqlDynamo from 'mysql-dynamo'; const connectionSettings = { host: 'localhost', user: 'root', password: 'secret', database: 'my_database' }; const tables = { users: { name: 'users', hashKey: 'id', hashKeyType: 'S', hashKeyLength: 255, rangeKey: 'created_at', rangeKeyType: 'N', rangeKeyLength: 10 } }; const dynamo = new MySqlDynamo(connectionSettings, tables); dynamo.createTable('users', function(err, result) { if (err) { console.error('Error creating table:', err); } else { console.log('Table created:', result); } }); dynamo.putItem('users', { id: '123', name: 'Alice' }, function(err, result) { if (err) { console.error('Error putting item:', err); } else { console.log('Item saved:', result); } });
Debug
Known issues
gotchaUndefined attributes in items are silently ignored; only attributes defined in table schema are stored.
fix
Define all necessary attributes in the table definition. Review your schema before inserting data.
affects: >=0.0.0
gotchaTable config options `consistent`, `overwriteExistingHash`, and `combineTableTo` from simple-dynamo are not supported and are ignored.
fix
Remove these options from your table config if migrating from simple-dynamo.
affects: >=0.0.0
deprecatedThis package is no longer actively maintained. Last update was in 2014. It may not work with recent Node.js versions or modern MySQL drivers.
fix
Consider using a more up-to-date library or migrating to AWS DynamoDB directly.
affects: >=0.3.3
gotchaField length must be specified for all attributes; no auto-detection or default lengths for undefined fields.
fix
Always include `length` in your attribute configs in table definitions.
affects: >=0.0.0
breakingRequires Node.js >0.8.* and may not be compatible with Node.js 10+ due to deprecated APIs.
fix
Use an older Node.js version (0.10 or 0.12) or migrate to a different solution.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'mysql-dynamo'
Package not installed or import path incorrect.
fix
Run `npm install mysql-dynamo` and ensure you use the correct import syntax: `import MySqlDynamo from 'mysql-dynamo'`.
TypeError: MySqlDynamo is not a constructor
Using CommonJS require with a default-exported ES6 module.
fix
Use import syntax: `import MySqlDynamo from 'mysql-dynamo'`.
ER_BAD_DB_ERROR: Unknown database 'database'
Database specified in connection settings does not exist.
fix
Create the database first using `CREATE DATABASE`, or change the connection settings to point to an existing database.
ER_TABLE_EXISTS_ERROR: Table 'users' already exists
Calling createTable for a table that already exists.
fix
Check if table exists before creating, or use `IF NOT EXISTS` (not supported by this library). Handle the error gracefully.
Upgrade
Version history
0.3.3latest on npm
Audit
Dependencies
mysqlrequiredRequired for MySQL database connectivity
underscorerequiredUsed for utility functions
hatrequiredUsed for generating UUIDs
asyncrequiredUsed for asynchronous control flow
Agent activity
4 hits · last 30 days
node
4
Resources
mysql-dynamo — npm install mysql-dynamo · libregistry