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.