-
Notifications
You must be signed in to change notification settings - Fork 2.8k
throw error when tracking table/function if there are conflicts (close #2020) #2383
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
Conversation
|
Beep boop! 🤖 Hey @ajeetdsouza, thanks for your PR! One of my human friends will review this PR and get back to you as soon as possible. 🕐 Stay awesome! 😎 |
|
Deploy preview for hasura-docs ready! Built with commit 674165f |
|
Review app for commit d69b6e4 deployed to Heroku: https://hge-ci-pull-2383.herokuapp.com |
|
Review app for commit 7010c87 deployed to Heroku: https://hge-ci-pull-2383.herokuapp.com |
shahidhk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Review app for commit 674165f deployed to Heroku: https://hge-ci-pull-2383.herokuapp.com |
|
Review app https://hge-ci-pull-2383.herokuapp.com is deleted |
|
Beep boop! 🤖 Awesome work @ajeetdsouza! All of us at Hasura ❤️ what you did. Thanks again 🤗 |
hasura#2383) Currently, we allow tracking of a table with the same name as an already tracked function, and vice-versa. This causes an issue when querying from GraphQL since it will only query the table and not the function. I've made changes to disallow this by throwing an error.
Currently, we allow tracking of a table with the same name as an already tracked function, and vice-versa. This causes an issue when querying from GraphQL since it will only query the table and not the function. I've made changes to disallow this by throwing an error.
Affected components
Related Issues
#2020
Solution and Design
I've added a condition in the phase 1 functions
trackFunctionP1andtrackTableP1to check if a function/table by the same name already exists, and to throw an error if this is true.Steps to test and verify
I've also added pytests in the
TestTrackTablesclass.Limitations, known bugs & workarounds
None
To the Reviewer (Server)
trackFunctionP1andtrackExistingTableOrViewP1now check if a functions or table with the same name is already being tracked.QualifiedObjectis now an instance ofFunctorTestTrackTablesCritical modules
src-lib/Hasura/RQL/DDL/Schema/Function.hssrc-lib/Hasura/RQL/DDL/Schema/Table.hstests-py/test_v1_queries.py(TestTrackTablesand the corresponding tests)