shiftcode / dynamo-easy

DynamoDB client for NodeJS and browser with a fluent api to build requests. We take care of the type mapping between JS and DynamoDB, customizable trough typescript decorators.
https://shiftcode.github.io/dynamo-easy/
MIT License
204 stars 27 forks source link

[Question] Is it possible to define the table name at run time? #307

Closed mariobittencourt closed 4 years ago

mariobittencourt commented 4 years ago

Hi, I would like to be able to define the table name at run time. Right now, at least from what I gathered I can only specify the table name with the @Model config options , which seems to be defined only at the definition of the model itself.

Regards,

simonmumenthaler commented 4 years ago
updateDynamoEasyConfig({  
  tableNameResolver: (tableName: string) =>  `myPrefix-${tableName}`
 })

Please have a look here: https://shiftcode.gitbook.io/dynamo-easy/api/dynamo-easy-config/configuration#tablenameresolver

mariobittencourt commented 4 years ago

thank you @simonmumenthaler