serverless-dynamodb-local
Advanced tools
Comparing version 0.2.20 to 0.2.21
16
index.js
@@ -90,3 +90,3 @@ "use strict"; | ||
"dynamodb:migrate:migrateHandler": this.migrateHandler.bind(this), | ||
"dynamodb:migrate:seedHandler": this.seedHandler.bind(this), | ||
"dynamodb:seed:seedHandler": this.seedHandler.bind(this), | ||
"dynamodb:remove:removeHandler": this.removeHandler.bind(this), | ||
@@ -152,4 +152,4 @@ "dynamodb:install:installHandler": this.installHandler.bind(this), | ||
}, | ||
this.options, | ||
config && config.start | ||
config && config.start, | ||
this.options | ||
); | ||
@@ -187,7 +187,11 @@ | ||
const seed = this.options.seed; | ||
if (!seed) { | ||
this.serverlessLog("DynamoDB - No seed categories defined. Skipping data seeding."); | ||
let categories; | ||
if (typeof seed === "string") { | ||
categories = seed.split(","); | ||
} else if(seed) { | ||
categories = Object.keys(seedConfig); | ||
} else { // if (!seed) | ||
this.serverlessLog("DynamoDB - No seeding defined. Skipping data seeding."); | ||
return []; | ||
} | ||
const categories = seed.split(","); | ||
const sourcesByCategory = categories.map((category) => seedConfig[category].sources); | ||
@@ -194,0 +198,0 @@ return [].concat.apply([], sourcesByCategory); |
{ | ||
"name": "serverless-dynamodb-local", | ||
"version": "0.2.20", | ||
"version": "0.2.21", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=4.0" |
@@ -130,2 +130,13 @@ serverless-dynamodb-local | ||
If seed config is set to true, your configuration will be seeded automatically on startup. You can also put the seed to false to prevent initial seeding to use manual seeding via cli. | ||
```fake-test-users.json example | ||
[ | ||
{ | ||
"id": "John", | ||
"name": "Doe", | ||
}, | ||
] | ||
``` | ||
## Using DynamoDB Local in your code | ||
@@ -132,0 +143,0 @@ You need to add the following parameters to the AWS NODE SDK dynamodb constructor |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
26119
317
189
0