Closed aneilbaboo closed 6 years ago
I support this change. Would you mind adding some unit tests for this new method?
Will do.
Hi @cdhowie
I've got 4 new commits:
#createTable
tests to test the same logic in makeCreateTableParams
table.createTable
calls dynamo.createTable
with the result from makeCreateTableParams
#createTable
testsmakeCreateTableParams
to dynamoParameters
I'm not sure how you feel about that third commit. I can roll it back if you'd like to keep the redundant createTable tests.
The test is failing because of an unrelated error at test/integration/integration-test.js:544:23
. Same problem on master.
@cdhowie - I made a final tweak - renamed the API to dynamoParameters
, which I think reads nicer.
Also updated the README.
@aneilbaboo I think the prior name makes more sense. The new name doesn't make it clear what the parameters are used for.
@cdhowie How about dynamoCreateTableParameters
? That makes it clear what service & what purpose it's for. makeTableCreateParameters
was looking a bit confusing in my code.
@cdhowie - I pushed a commit that changes it to model.dynamoCreateTableParams()
- is that ok? Or do you want me to revert to model.makeCreateTableParams()
?
@aneilbaboo The only issue I see remaining is the presence of the yarn-error.log
file. Can you remove that?
Oooof. Sorry about that.
Thanks, @cdhowie - Removed it and added yarn-error.log to .gitignore
This is a small change which extracts the functionality for generating the Dynamo CreateTable API arguments from
Table.prototype.createTable
toTable.prototype.dynamoParameters
.I use Serverless to manage deployment (and teardown) of DynamoDB tables. To do this, I need the AWS CreateTable params. I'd prefer to avoid having to keep the Serverless table descriptions in sync with Dynogels, and it's nicer to describe the tables in Dynogels anyway. This change enables that. It's probably useful in some other contexts too.
The new API is:
Where
options
are the same as the first argument toTable.prototype.createTable
.Note:
Changed the method from
makeCreateTableParams
todynamoParameters
.