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

Add table name alias an prefix support #116

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

roberth-k
Copy link
Contributor

Adds table name aliasing and an optional table name prefix. Both are configured at dynamo.DB level.

It's similar to what's offered by the AWS .NET Core SDK.

In a call to db.Table(name) or db.CreateTable(name, ...): if the name is a key in the db's alias mapping, it is replaced by its value in the alias mapping. Finally, the prefix is prepended to the name. The alias mapping and prefix are initially empty, so the default behaviour remains unchanged.

This is a convenience feature for applications that must permit overrides of individual table names, allowing for this configuration to be decoupled from the construction of dynamo.Table. By setting up a randomly generated prefix, it can also simplify testing where dynamo.DB is involved.

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

Successfully merging this pull request may close these issues.

1 participant