Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support table index #33

Merged
merged 1 commit into from Jun 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions bin/dynamo-archive.js
Expand Up @@ -19,9 +19,9 @@ var sleep = require('sleep');

var argv = utils.config({
demand: ['table'],
optional: ['rate', 'query', 'key', 'secret', 'region'],
optional: ['rate', 'query', 'key', 'secret', 'region', 'index'],
usage: 'Archives Dynamo DB table to standard output in JSON\n' +
'Usage: dynamo-archive --table my-table [--rate 100] [--query "{}"] [--region us-east-1] [--key AK...AA] [--secret 7a...IG]'
'Usage: dynamo-archive --table my-table [--rate 100] [--query "{}"] [--region us-east-1] [--key AK...AA] [--secret 7a...IG] [--index index-name]'
});

var dynamo = utils.dynamo(argv);
Expand Down Expand Up @@ -73,6 +73,10 @@ dynamo.describeTable(
ReturnConsumedCapacity: 'NONE',
Limit: data.Table.ProvisionedThroughput.ReadCapacityUnits
};
if (argv.index) {
params.IndexName = argv.index
}

if (argv.query) {
params.KeyConditions = JSON.parse(argv.query);
}
Expand Down