dynamodb-admin
Advanced tools
Comparing version 3.1.1 to 3.1.2
const { doSearch } = require('../util') | ||
const findPrimaryKey = context => { | ||
const findPrimaryKeys = context => { | ||
const params = { | ||
@@ -10,4 +10,10 @@ TableName: context.tableName | ||
.then(tableDescription => { | ||
context.primaryKey = tableDescription.Table.KeySchema.find( | ||
element => element.KeyType === 'HASH').AttributeName | ||
const tableSchema = tableDescription.Table.KeySchema | ||
context.primaryKeys = ['HASH', 'RANGE'] | ||
.map(keyType => tableSchema.find(element => element.KeyType === keyType)) | ||
.filter(attribute => attribute) | ||
.map(attribute => attribute.AttributeName) | ||
return context | ||
@@ -30,5 +36,3 @@ }) | ||
DeleteRequest: { | ||
Key: { | ||
[context.primaryKey]: item[context.primaryKey] | ||
} | ||
Key: item | ||
} | ||
@@ -55,3 +59,3 @@ }) | ||
const scanParams = { | ||
ProjectionExpression: context.primaryKey, | ||
ProjectionExpression: context.primaryKeys.join(', '), | ||
} | ||
@@ -87,3 +91,3 @@ | ||
return findPrimaryKey(context) | ||
return findPrimaryKeys(context) | ||
.then(findAllElements) | ||
@@ -93,2 +97,2 @@ .then(deleteAllElements) | ||
module.exports = {purgeTable} | ||
module.exports = { purgeTable } |
{ | ||
"name": "dynamodb-admin", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "GUI for DynamoDB. Useful for local development.", | ||
@@ -11,4 +11,10 @@ "main": "lib/backend.js", | ||
"lint": "eslint --ext .js .", | ||
"fix": "eslint --ext .js --fix .", | ||
"test": "jest" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "npm run lint" | ||
} | ||
}, | ||
"repository": { | ||
@@ -30,3 +36,3 @@ "type": "git", | ||
"argparse": "^1.0.10", | ||
"aws-sdk": "^2.390.0", | ||
"aws-sdk": "^2.411.0", | ||
"body-parser": "^1.18.3", | ||
@@ -42,7 +48,8 @@ "cli-color": "^1.3.0", | ||
"devDependencies": { | ||
"eslint": "^5.12.0", | ||
"eslint-plugin-jest": "^22.1.0", | ||
"jest-cli": "^23.6.0", | ||
"nodemon": "^1.18.9" | ||
"eslint": "^5.14.1", | ||
"eslint-plugin-jest": "^22.3.0", | ||
"husky": "^1.3.1", | ||
"jest-cli": "^24.1.0", | ||
"nodemon": "^1.18.10" | ||
} | ||
} |
# dynamodb-admin | ||
[![npm](https://img.shields.io/npm/v/dynamodb-admin.svg)](https://www.npmjs.com/package/dynamodb-admin) | ||
[![CircleCI (all branches)](https://img.shields.io/circleci/project/github/aaronshaf/dynamodb-admin.svg)](https://circleci.com/gh/aaronshaf/dynamodb-admin) | ||
[![CircleCI](https://circleci.com/gh/aaronshaf/dynamodb-admin/tree/master.svg?style=svg)](https://circleci.com/gh/aaronshaf/dynamodb-admin/tree/master) | ||
> GUI for [DynamoDB Local](https://aws.amazon.com/blogs/aws/dynamodb-local-for-desktop-development/) or [dynalite](https://github.com/mhart/dynalite). | ||
@@ -12,3 +11,3 @@ | ||
``` | ||
```bash | ||
npm install dynamodb-admin -g | ||
@@ -35,3 +34,3 @@ export DYNAMO_ENDPOINT=http://localhost:8000 | ||
``` | ||
```js | ||
const AWS = require('aws-sdk'); | ||
@@ -38,0 +37,0 @@ const {createServer} = require('dynamodb-admin'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
796831
3931
5
58
Updatedaws-sdk@^2.411.0