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

Easily update the tablename #337

Open
andreujuanc opened this issue Dec 8, 2020 · 0 comments
Open

Easily update the tablename #337

andreujuanc opened this issue Dec 8, 2020 · 0 comments

Comments

@andreujuanc
Copy link

Hi it's me!
I'm checking out your library and it looks very promising. I almost got something working but:

Is your feature request related to a problem? Please describe.
I needed to set the table name on run time, but I find cumbersome to call updateDynamoEasyConfig everywhere.
I do not have a "central" entry-point, so this forces my code to create that central entry point. (im doing lambdas)

Describe the solution you'd like
Since stores instances are per model. It'd be nice if we could override the values of the tablename here:
https://github.com/shiftcode/dynamo-easy/blob/master/src/dynamo/dynamo-store.ts#L36
So i could do something like :

new DynamoStore(Profile, {
   tablename: 'users-stage-98754'
})

Describe alternatives you've considered
I'm trying to set this up with updateDynamoEasyConfig but it makes my code ugly, and I cannot have it dangling since my code is serialized into a bundle, and because updateDynamoEasyConfig is not being referenced by the executing code it wont be deployed. I have similar issue in which I have to call require('reflect-metadata') because the import is not being taken into account.
So basically I'll have to copy pasta that portion of the code on every handler, or "import" a common

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant