This message was deleted.
# opal
s
This message was deleted.
d
I'd like to set them up like that based on the Policy Performance recommendations. https://www.openpolicyagent.org/docs/latest/policy-performance/#use-objects-over-arrays
I am using the postgres fetcher to get the data here, but I'm not sure if that's something that need be handled in the logic of the specific fetcher
o
Hi I think you can use the
"fetch_one": True
config entry to set achieve that. And of course you can customize things even more by forking the fetcher and editing that process method: https://github.com/permitio/opal-fetcher-postgres/blob/fee44e10240a094444c76f51bf6e7a5832f85891/src/opal_fetcher_postgres/provider.py#L172
d
Copy code
fetch_one: bool = Field(
        False,
        description="whether we fetch only one row from the results of the SELECT query",
    )
This actually only returns the first item from the list
looks like I'd need to implement it
💪 2
o
I’ll ask @Asaf Cohen to review 🙂
d
Just realized that this PR https://github.com/permitio/opal-fetcher-postgres/pull/12 does the same thing as what I implemented but was never merged... which is probably why you thought it was already there @Or Weis
May want to confirm and close that PR
o
😅 - good catch @Ro'e Katz I’d leave pruning for you here
d
No sweat, who remembers January? I don't
😛 1