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

feat(typeorm): allow overriding tables schema #661

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sripwoud
Copy link

@sripwoud sripwoud commented Feb 2, 2025

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 to public.
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?

  • Yes
  • No

Other information

Other options I have considered:

  • rename my own tables
    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.
  • use a separate DB for bandada
    Means more overhead. More resources to host that new DB. New DB settings and secrets to manage etc...

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have run yarn prettier and yarn lint without getting any errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Important

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.

Copy link

vercel bot commented Feb 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bandada-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 2, 2025 2:15pm
bandada-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 2, 2025 2:15pm

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