New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@eolas-medical/dynamodb-migrator-cli

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eolas-medical/dynamodb-migrator-cli

DynamoDB Migrator

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19
increased by46.15%
Maintainers
2
Weekly downloads
 
Created
Source

dynamodb-migrator-cli

Install

npm i @eolas-medical/dynamodb-migrator-cli --save-dev

Usage

1. Configuration file

Set the config options in .dynamodb-migratorrc.<json|yaml|yml|js|cjs> or dynamodb-migrator.config.<js|cjs>:

Config Options

// example dynamodb-migrator.config.js
module.exports = {
  migrationsPath: "./migrations", // the directory name where the migration files are listed
  region: "eu-west-1",
  endpoint: "http://localhost:8000", // optional, local dev only
  tableName: "migrations", // the table to use to store which migrations have ran
  keyName: "migrationName", // the primary key in the dynamodb table
};

2. Generate a migration file

dynamodb-migrator generate <name-of-migration>

3. Update the generated migration file

// example ./migrations/<generated-file-name>.js

import { UpdateCommand } from "@aws-sdk/lib-dynamodb";

module.exports = {
  up: async (db) => {
    // db is an instance of @aws dynamodb document client v3.
    return db.send(
      new UpdateCommand({
        TableName: "TableName",
        Key: {
          id: "abc-123",
        },
        UpdateExpression: "SET #newAttr = :newAttr",
        ExpressionAttributeNames: {
          "#newAttr": "newAttr",
        },
        ExpressionAttributeValues: {
          ":newAttr": "new attribute",
        },
      })
    );
  },

  down: () => {},
};

FAQs

Package last updated on 15 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc