feat(typeorm): allow overriding tables schema #661
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When integrating bandada in another project, bandada table names may clash with other existing tables (especially the
groups
table).One way to elegantly solve such a table name clash issue is to scope tables by schema.
However by doing this,
typeorm
won't find the table anymore because it isn't set to use a specific schema and default topublic
.This PR adds an override by env var to set the schema in which all the tables used by the api will be defined.
(e.g
schema
option for typeorm postgres driver).Related Issue
Does this introduce a breaking change?
Other information
Other options I have considered:
Will require renaming lot of things in my source code because the model names/modules will change. Moreover other people may integrate bandada with another "vendor" project and may not be able at all to rename things.
Means more overhead. More resources to host that new DB. New DB settings and secrets to manage etc...
Checklist
yarn prettier
andyarn lint
without getting any errorsImportant
We do not accept minor grammatical fixes (e.g., correcting typos, rewording sentences) unless they significantly improve clarity in technical documentation. These contributions, while appreciated, are not a priority for merging. If there is a grammatical error feel free to message the team.