dynamit-cli
Version:
The DynamoDB migrations tool CLI
45 lines (44 loc) • 1.42 kB
TypeScript
import { DocumentClient } from 'aws-sdk/clients/dynamodb';
import { Storage } from 'umzug';
interface DynamoDBStorageOptions {
dynamodb?: DocumentClient;
tableName?: string;
attributeName?: string;
timestamp?: boolean;
}
/**
* @class DynamoDBStorage
*/
export default class DynamoDBStorage implements Storage {
private dynamodb;
private tableName;
private attributeName;
private timestamp;
/**
* Constructs DynamoDB table storage.
*
* @param options
* @param options.dynamodb - a DynamoDB document client instance
* @param options.tableName - name of migration table in DynamoDB
* @param options.attributeName - name of the table primaryKey attribute in DynamoDB
* @param options.timestamp - option to add timestamps to the DynamoDB table
*/
constructor({ dynamodb, tableName, attributeName, timestamp }?: DynamoDBStorageOptions);
/**
* Logs migration to be considered as executed.
*
* @param migrationName - Name of the migration to be logged.
*/
logMigration(migrationName: string): Promise<void>;
/**
* Unlogs migration to be considered as pending.
*
* @param migrationName - Name of the migration to be unlogged.
*/
unlogMigration(migrationName: string): Promise<void>;
/**
* Gets list of executed migrations.
*/
executed(): Promise<string[]>;
}
export {};