hasura / graphql-engine

Blazing fast, instant realtime GraphQL APIs on your DB with fine grained access control, also trigger webhooks on database events.
https://hasura.io
Apache License 2.0
31.09k stars 2.77k forks source link

Allow turning off the database schema prefix #6890

Open ksummerlin opened 3 years ago

ksummerlin commented 3 years ago

We recently broke out 50 tables into a separate schema that are shared across multiple databases. We mainly broke them out to allow that schema to have separate database migrations that are versioned differently than the main hosting database. Unfortunately this means that now Hasura prefixes all of those tables with the name of the schema, and now all of the existing GraphQL queries are broken. Now I either have to manually redo all the code that references those GraphQL queries or manually set the root fields -- both of which are a lot of manual work. Additionally the types in the generated GraphQL schema are prefixed as well so it makes it almost impossible to migrate a set of tables to another schema without completely rewriting the previously working code.

I understand that prefixing the tables outside the public namespace is a reasonable default -- but not having a way to turn on/off that default is an oversight. Give us a way to globally turn off the automatic prefix for database schemas.

This issue is similar to "Optional database schema prefix" #5394

steffen74 commented 1 year ago

We would mainly like to use schemas to organize the tables according to different frontend applications. categorizing them into those who are used by all applications and those which are used by only a single one. That way new developers have a much quicker overview of the existing table relevant to application they want to work on.