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

server: fix issue with tracking custom functions that return SETOF materialized view (close #5294) #5945

Merged
merged 19 commits into from
Oct 22, 2020
Merged

server: fix issue with tracking custom functions that return SETOF materialized view (close #5294) #5945

merged 19 commits into from
Oct 22, 2020

Conversation

kolharsam
Copy link
Contributor

@kolharsam kolharsam commented Oct 7, 2020

fixes #5294

Description

This PR adds a fix to help track custom functions that return a setof elements from a materialized view.

Affected components

  • Server
  • Tests

Steps to test and verify

  • Create a Materialized View
  • Create a custom function that returns setof materialized view
  • Click on track function on Data page to see if this custom function is tracked.
  • Run Graphql queries from GraphiQL editor to verify,.

Server checklist

Catalog upgrade

Does this PR change Hasura Catalog version?

  • Yes

Metadata

Does this PR add a new Metadata feature?

  • No

GraphQL

  • No new GraphQL schema is generated

Breaking changes

  • No Breaking changes

@kolharsam kolharsam added s/do-not-merge Do not merge this pull request to master c/server Related to server labels Oct 7, 2020
@kolharsam kolharsam self-assigned this Oct 7, 2020
Copy link
Contributor

@sordina sordina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the change actually restricted to setof return types, or materialised views in general?

server/src-lib/Hasura/SQL/Types.hs Show resolved Hide resolved
@kolharsam
Copy link
Contributor Author

kolharsam commented Oct 7, 2020

Is the change actually restricted to setof return types, or materialised views in general?

@sordina It is for setof return types. So for custom functions, the return type has to be table type. So yeah, that would include Tables, Views and materialized views. The problem was that previously, only information_schema.tables was checked to see if a custom function returns a table type. This PR makes sure that functions that return from materialized views are also trackable.

@kolharsam kolharsam removed the s/do-not-merge Do not merge this pull request to master label Oct 8, 2020
@kolharsam kolharsam marked this pull request as ready for review October 8, 2020 09:52
@netlify
Copy link

netlify bot commented Oct 16, 2020

Deploy preview for hasura-docs ready!

Built with commit 92c0e4f

https://deploy-preview-5945--hasura-docs.netlify.app

@kolharsam kolharsam changed the title server: track functions which return setof elements from a materialized view server: fix issue with tracking custom functions that return SETOF materialized view (close #5294) Oct 16, 2020
Copy link
Contributor

@tirumaraiselvan tirumaraiselvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changelog approved

@kolharsam kolharsam requested a review from 0x777 October 16, 2020 10:39
@kolharsam kolharsam requested a review from a team as a code owner October 16, 2020 11:08
@netlify
Copy link

netlify bot commented Oct 19, 2020

Deploy preview for hasura-docs ready!

Built with commit 6631bd9

https://deploy-preview-5945--hasura-docs.netlify.app

Copy link
Member

@rakeshkky rakeshkky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

server LGTM

@kodiakhq kodiakhq bot merged commit b72fc69 into hasura:master Oct 22, 2020
@reinoldus
Copy link

Is there a docker container available with this fix? Or would I have to build it myself, if I need this fix?

@kolharsam
Copy link
Contributor Author

@reinoldus there is a built image available here if you'd like to use it. You could also build the latest from the master branch to use this fix.

v0d1ch pushed a commit to v0d1ch/graphql-engine that referenced this pull request Oct 29, 2020
@tirumaraiselvan tirumaraiselvan added this to the v1.3.3 milestone Nov 4, 2020
codingkarthik pushed a commit to codingkarthik/graphql-engine that referenced this pull request Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/server Related to server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: cannot track a custom function which returns materialized view
6 participants