-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
c/serverRelated to serverRelated to serverk/enhancementNew feature or improve an existing featureNew feature or improve an existing featurep/highcandidate for being included in the upcoming sprintcandidate for being included in the upcoming sprint
Description
It would be really cool to be able to define a function like
CREATE OR REPLACE FUNCTION article_liked(article_row article, hasura_session json)
RETURNS boolean AS $$
SELECT EXISTS (
SELECT 1
FROM liked_article A
WHERE A.user_id = hasura_session ->> 'x-hasura-user-id' AND A.article_id = article_row.id
);
$$ LANGUAGE sql STABLE;
and use it via a computed field without any args.
I know that in order to get hasura_session injected the function needs to be tracked, but tracked functions only support SETOF return types.
I can dive in a try to do a PR if there's interest in this kind of functionality.
coco98, reinvanimschoot, shinnoki, dminkovsky, ivbond and 7 morecoco98, reinvanimschoot, shinnoki, dminkovsky and ivbond
Metadata
Metadata
Assignees
Labels
c/serverRelated to serverRelated to serverk/enhancementNew feature or improve an existing featureNew feature or improve an existing featurep/highcandidate for being included in the upcoming sprintcandidate for being included in the upcoming sprint