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

Filtering on Computed Columns #357

Open
arbela-cyberillium opened this issue May 14, 2023 · 2 comments · Fixed by #349
Open

Filtering on Computed Columns #357

arbela-cyberillium opened this issue May 14, 2023 · 2 comments · Fixed by #349
Assignees
Labels
enhancement New feature or request

Comments

@arbela-cyberillium
Copy link

I have a table with many to one relationship (affected_entity -> entity)

When I query affected_entity, I want to filter by the fields of entity table.
But the only filters I have are like:

affected_entityFilter

Fields
id: UUIDFilter
entity_id: UUIDFilter

In the affected_entity node I can access entity, but without filters

Can I help in any way?

@arbela-cyberillium arbela-cyberillium added the triage-required Pending triage from maintainers label May 14, 2023
@arbela-cyberillium
Copy link
Author

arbela-cyberillium commented May 15, 2023

I can create a Computed Field, with

CREATE OR REPLACE FUNCTION public._affected_entity_entity_name(ae public.affected_entity) 
RETURNS TEXT AS $$
DECLARE 
    entity_name TEXT;
BEGIN
    SELECT name INTO entity_name
    FROM public.entity
    WHERE id = ae.entity_id
    LIMIT 1;

    RETURN entity_name;
END;
$$ LANGUAGE plpgsql;

but I can not filter it as well. if we add support to filtering Computed Fields, maybe it will be a good enough workaround, and easier to implement

@olirice olirice added enhancement New feature or request and removed triage-required Pending triage from maintainers labels May 15, 2023
@olirice
Copy link
Contributor

olirice commented Jun 9, 2023

Sorry I must have linked to the wrong issue in my PR. This isn't resolved.

your request from the first comment is a dupe of #88

but your comment about filtering on computed columns is a good one. I'm going to change the title of this issue to that and re-open

@olirice olirice reopened this Jun 9, 2023
@olirice olirice changed the title filter embedded objects Filtering on Computed Columns Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants