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

issue with modifying custom function #1560

Closed
rikinsk-zz opened this issue Feb 5, 2019 · 5 comments · Fixed by #1563
Closed

issue with modifying custom function #1560

rikinsk-zz opened this issue Feb 5, 2019 · 5 comments · Fixed by #1563
Assignees
Labels
c/server Related to server k/bug Something isn't working

Comments

@rikinsk-zz
Copy link

rikinsk-zz commented Feb 5, 2019

modifying custom function not functioning as expected

  • running with Track this enabled throws error
  • modifying arguments doesnt do anything (edit: seems to be creating a duplicate fn in the background)
@rikinsk-zz rikinsk-zz added k/bug Something isn't working c/server Related to server labels Feb 5, 2019
@rakeshkky
Copy link
Member

  • running with Track this enabled throws error

Console makes track_function query, which obviously fails since the function tracked already.

  • modifying arguments doesnt do anything (edit: seems to be creating a duplicate fn in the background)

Postgres supports function overloading. We can have more than one functions with same schema and name but with different input argument types. GraphQL Engine do not support overloaded functions. It is supposed to restrict overloading an already tracked function if it is being done through run_sql query. I'm adding this check here.

@karthikvt26
Copy link
Contributor

@rikinsk @rakeshkky If I track from where the user is coming to Raw SQL page and not send a track query. It should do it right? will there be any implications of this?

The only problem I see is that if user tries to change the signature of the function (name or parameters) it will be affected.

Let me know your views.

@rikinsk-zz
Copy link
Author

The Track this behaviour is consistent with modifying views as well. Altleast that's a good thing.

But I am not a fan of the experience. If something is already tracked and I send a modify request with track this enabled, the action shouldn't fail.

@0x777 Thoughts?

@0x777
Copy link
Member

0x777 commented Feb 6, 2019

Maybe we can add ignore_if_tracked flag to track_table and track_function queries, similar to IF NOT EXISTS in sql?

@0x777
Copy link
Member

0x777 commented Feb 6, 2019

I think the root cause is our current solution of redirecting to the SQL page for modifying a view/function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/server Related to server k/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants