Registry / database / dynograte

dynograte

JSON →
library2.2.2jsnpmunverified

Dynograte is a Node.js DynamoDB migration tool that tracks migration state in a DynamoDB table. It supports migrations from directories or functions, retry logic via the 'tri' module, and a CLI for generating migration files. Version 2.2.2 is the latest stable release. Key differentiators: lightweight, no external database needed, retry and failure recovery features. Release cadence is low; last release was 2016.

npm install dynograte
INSTALL
IMPORT
SIG · DYNOGRATE
D
dynograte
databasejavascriptv2.2.2
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.

dynograte
import dynograte from 'dynograte'
const dynograte = require('dynograte')
Default export is a namespace with 'migrate', 'create' etc.
migrate
import { migrate } from 'dynograte'
import dynograte from 'dynograte'; dynograte.migrate();
Named export available for direct use.
create
import { create } from 'dynograte'
Used for generating migration files.

Demonstrates basic usage: create DynamoDB client, run migrations from a directory.

const { migrate } = require('dynograte'); const AWS = require('aws-sdk'); const dynamodb = new AWS.DynamoDB({ region: 'us-east-1' }); migrate({ dynamodb: dynamodb, migrationTableName: 'my-migrations', migrationDir: './migrations' }).then(() => console.log('Migrations complete')).catch(err => console.error(err));
Debug
Known issues
gotchaMigration files export 'up' function; DynamoDB instance passed by the library is mutated.
fix
Treat the dynamodb argument as a reference to the same client instance.
affects: >=1.0.0
deprecatedRetry feature uses 'tri' module which is unmaintained.
fix
Use a custom retry mechanism instead.
affects: >=2.0.0
gotchaDynograte requires 'aws-sdk' v2; not compatible with v3.
fix
Use aws-sdk v2, or wrap Dynograte with a v2 client when using v3.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'tri'
Missing optional dependency 'tri' when using retry.
fix
Install 'tri' via npm install tri.
TypeError: dynamodb.listTables is not a function
The dynamodb argument is not a valid DynamoDB client.
fix
Ensure the argument is an instance of AWS.DynamoDB.
ValidationException: The table already exists
Migration table already exists but with different schema.
fix
Delete the existing migration table or use a different table name.
Upgrade
Version history
2.2.2latest on npm
Audit
Dependencies
aws-sdkrequiredDynamoDB client used to interact with DynamoDB
trioptionalRetry logic for migrations
Agent activity
9 hits · last 30 days
node
8
Resources
dynograte — npm install dynograte · libregistry