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

Bug: cannot track a custom function which returns materialized view #5294

Closed
hsheth2 opened this issue Jul 3, 2020 · 0 comments · Fixed by #5945
Closed

Bug: cannot track a custom function which returns materialized view #5294

hsheth2 opened this issue Jul 3, 2020 · 0 comments · Fixed by #5945
Labels
c/server Related to server

Comments

@hsheth2
Copy link

hsheth2 commented Jul 3, 2020

I have a materialized view called course_info_table. This view is tracked by Hasura. I've created a custom function as follows:

CREATE FUNCTION search_course_info(query text)
RETURNS SETOF course_info_table AS $$
    SELECT *
    FROM course_info_table
    WHERE info @@ websearch_to_tsquery('english', query)
    ORDER BY ts_rank(info, websearch_to_tsquery('english', query)) DESC
$$ language sql stable;

When I attempt to track this function in Hasura, I get the following error:

[
    {
        "definition": {
            "schema": "public",
            "name": "search_course_info"
        },
        "reason": "in function \"search_course_info\": the function \"search_course_info\" cannot be tracked because the function does not return a SETOF table",
        "type": "function"
    }
]

I'm running Hasura v1.2.2 via Docker.

@tirumaraiselvan tirumaraiselvan added c/server Related to server support/needs-triage Needs to be triaged so that we have enough information to add this to our backlog labels Jul 4, 2020
@tirumaraiselvan tirumaraiselvan removed the support/needs-triage Needs to be triaged so that we have enough information to add this to our backlog label Sep 24, 2020
@kodiakhq kodiakhq bot closed this as completed in #5945 Oct 22, 2020
kodiakhq bot pushed a commit that referenced this issue Oct 22, 2020
v0d1ch pushed a commit to v0d1ch/graphql-engine that referenced this issue Oct 29, 2020
codingkarthik pushed a commit to codingkarthik/graphql-engine that referenced this issue 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 a pull request may close this issue.

2 participants